Skip to content

Commit b1016bb

Browse files
etoyamaclaude
andcommitted
feat: display methodology and analysis_intent in WebUI review sections
Add methodology and analysis_intent to ALLOWED_TARGET_SECTIONS (backend) and COMMENTABLE_SECTIONS (frontend) so they appear as reviewable inline comment targets in the design detail view. Closes #45. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ae83b03 commit b1016bb

6 files changed

Lines changed: 66 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Added methodology and analysis_intent as reviewable sections in WebUI inline comments
13+
1014
## [0.2.0] - 2026-03-11
1115

1216
### Added

frontend/e2e/design-detail.spec.ts

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,54 @@ test("#5: overview panel displays design fields and metrics", async ({
6767
await expect(page.getByText("0.95")).toBeVisible();
6868
});
6969

70+
// #5b: analysis_intent displays as text
71+
test("#5b: analysis_intent displays in overview panel", async ({ page }) => {
72+
const designWithIntent = makeDesign({
73+
id: "d-intent",
74+
title: "Intent Design",
75+
status: "in_review",
76+
analysis_intent: "confirmatory",
77+
});
78+
await mockDesignList(page, [designWithIntent]);
79+
await mockDesignDetail(page, designWithIntent);
80+
await mockComments(page, designWithIntent.id, []);
81+
82+
await page.goto("/?tab=designs");
83+
await page.getByText("Intent Design").click();
84+
85+
await expect(page.getByRole("tab", { name: /overview/i })).toBeVisible({
86+
timeout: 5000,
87+
});
88+
89+
await expect(page.getByText("Analysis Intent")).toBeVisible();
90+
await expect(page.getByText("confirmatory")).toBeVisible();
91+
});
92+
93+
// #5c: methodology displays as JsonTree when set
94+
test("#5c: methodology displays in overview panel when set", async ({
95+
page,
96+
}) => {
97+
const designWithMethodology = makeDesign({
98+
id: "d-method",
99+
title: "Methodology Design",
100+
status: "in_review",
101+
methodology: { approach: "regression", tool: "statsmodels" },
102+
});
103+
await mockDesignList(page, [designWithMethodology]);
104+
await mockDesignDetail(page, designWithMethodology);
105+
await mockComments(page, designWithMethodology.id, []);
106+
107+
await page.goto("/?tab=designs");
108+
await page.getByText("Methodology Design").click();
109+
110+
await expect(page.getByRole("tab", { name: /overview/i })).toBeVisible({
111+
timeout: 5000,
112+
});
113+
114+
await expect(page.getByText("Methodology", { exact: true })).toBeVisible();
115+
await expect(page.getByText("regression")).toBeVisible();
116+
});
117+
70118
// #6: Workflow guide display — verify workflow guide shows for in_review design
71119
test("#6: workflow guide displays for in_review design", async ({ page }) => {
72120
await mockDesignList(page, [activeDesign]);
@@ -177,8 +225,8 @@ test.describe("Inline Review Comments", () => {
177225
await expect(page.getByRole("tab", { name: /overview/i })).toBeVisible({ timeout: 5000 });
178226
const buttons = page.getByTestId("comment-button");
179227
await expect(buttons.first()).toBeVisible({ timeout: 5000 });
180-
// Should have 7 comment buttons (one per commentable section)
181-
await expect(buttons).toHaveCount(7);
228+
// Should have 9 comment buttons (one per commentable section)
229+
await expect(buttons).toHaveCount(9);
182230
});
183231

184232
test("comment buttons hidden on non-in_review design", async ({ page }) => {

frontend/e2e/fixtures/mock-data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export interface Design {
1616
source_ids: string[];
1717
next_action: Record<string, unknown> | null;
1818
referenced_knowledge: Record<string, string[]>;
19+
analysis_intent: string;
20+
methodology: Record<string, unknown> | null;
1921
created_at: string;
2022
updated_at: string;
2123
}
@@ -35,6 +37,8 @@ export function makeDesign(overrides?: Partial<Design>): Design {
3537
source_ids: [],
3638
next_action: null,
3739
referenced_knowledge: {},
40+
analysis_intent: "exploratory",
41+
methodology: null,
3842
created_at: "2026-01-01T00:00:00",
3943
updated_at: "2026-01-01T00:00:00",
4044
...overrides,

frontend/src/pages/design-detail/components/sections.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export interface CommentableSection {
1010
export const COMMENTABLE_SECTIONS: readonly CommentableSection[] = [
1111
{ id: "hypothesis_statement", label: "Hypothesis Statement", type: "text" },
1212
{ id: "hypothesis_background", label: "Hypothesis Background", type: "text" },
13+
{ id: "analysis_intent", label: "Analysis Intent", type: "text" },
14+
{ id: "methodology", label: "Methodology", type: "json" },
1315
{ id: "metrics", label: "Metrics", type: "json" },
1416
{ id: "explanatory", label: "Explanatory", type: "json" },
1517
{ id: "chart", label: "Chart", type: "json" },

src/insight_blueprint/core/reviews.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
"chart",
4747
"next_action",
4848
"referenced_knowledge",
49+
"methodology",
50+
"analysis_intent",
4951
}
5052

5153
VALID_TRANSITIONS: dict[DesignStatus, set[DesignStatus]] = {

tests/test_reviews.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,9 @@ class TestSaveReviewBatchTargetSectionValidation:
906906
"explanatory",
907907
"chart",
908908
"next_action",
909+
"referenced_knowledge",
910+
"methodology",
911+
"analysis_intent",
909912
],
910913
)
911914
def test_valid_target_sections_accepted(
@@ -914,7 +917,7 @@ def test_valid_target_sections_accepted(
914917
pending_design: AnalysisDesign,
915918
section: str,
916919
) -> None:
917-
"""NFR-7: All 6 valid sections are accepted."""
920+
"""NFR-7: All 9 valid sections are accepted."""
918921
result = review_service.save_review_batch(
919922
pending_design.id,
920923
"supported",

0 commit comments

Comments
 (0)