Skip to content

Commit 8ebbd17

Browse files
committed
fix(review-feedback-1307): Disable follow-up for market-review history rows
1 parent d66ae26 commit 8ebbd17

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

apps/dsa-web/src/pages/HomePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const HomePage: React.FC = () => {
162162
);
163163

164164
const handleAskFollowUp = useCallback(() => {
165-
if (selectedReport?.meta.id === undefined) {
165+
if (selectedReport?.meta.id === undefined || selectedReport.meta.reportType === 'market_review') {
166166
return;
167167
}
168168

@@ -596,7 +596,7 @@ const HomePage: React.FC = () => {
596596
<Button
597597
variant="home-action-ai"
598598
size="sm"
599-
disabled={selectedReport.meta.id === undefined}
599+
disabled={selectedReport.meta.id === undefined || isMarketReviewHistoryReport}
600600
onClick={handleAskFollowUp}
601601
>
602602
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">

apps/dsa-web/src/pages/__tests__/HomePage.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ describe('HomePage', () => {
519519
}));
520520
});
521521

522-
it('disables stock reanalysis for market review history reports', async () => {
522+
it('disables stock reanalysis and follow-up for market review history reports', async () => {
523523
vi.mocked(historyApi.getList).mockResolvedValue({
524524
total: 1,
525525
page: 1,
@@ -536,11 +536,15 @@ describe('HomePage', () => {
536536

537537
await screen.findByText('大盘复盘摘要');
538538
const reanalyzeButton = screen.getByRole('button', { name: '重新分析' });
539+
const followUpButton = screen.getByRole('button', { name: '追问 AI' });
539540

540541
expect(reanalyzeButton).toBeDisabled();
542+
expect(followUpButton).toBeDisabled();
541543

542544
fireEvent.click(reanalyzeButton);
545+
fireEvent.click(followUpButton);
543546

544547
expect(analysisApi.analyzeAsync).not.toHaveBeenCalled();
548+
expect(navigateMock).not.toHaveBeenCalled();
545549
});
546550
});

0 commit comments

Comments
 (0)