-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Polish — ship progress export (U11) #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e4d1704
test(infra): add Vitest + Playwright harness and CI gate
Steel-tech 2586fc5
refactor(estimator): extract constants, clamp inputs, add money-math …
Steel-tech 3871089
feat(content): add state-data verification metadata + legal disclaimer
Steel-tech 2bd7ba3
fix(content): replace silent Washington fallback + add contract tests
Steel-tech 9ee9670
fix(security): extend CSRF gate to all API routes; centralize headers
Steel-tech 90f38da
fix(review): cap estimator inputs + close test-coverage gaps
Steel-tech c318a4d
fix(ci): run on node 24 to match the lockfile's npm
Steel-tech ed3beac
feat(wizard): ship progress export (JSON/CSV); remove dead DC alias
Steel-tech 09af7de
refactor(wizard): extract chat SSE parsing into a tested module
Steel-tech 6fe8e35
fix(wizard): buffer SSE frames across chunk boundaries
Steel-tech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| # Match the local dev / lockfile npm version — node 22's older npm | ||
| # resolves the SWC plugin's transitive @swc/helpers differently and | ||
| # rejects the lockfile under `npm ci`. | ||
| node-version: 24 | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run lint | ||
| - run: npm run typecheck | ||
| - run: npm test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-or-later | ||
| // Copyright (C) 2026 Steel-Tech / StructuPath | ||
| import { describe, it, expect } from "vitest"; | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { Badge } from "@/components/ui/badge"; | ||
|
|
||
| describe("Badge", () => { | ||
| it("renders its children", () => { | ||
| render(<Badge>Active</Badge>); | ||
| expect(screen.getByText("Active")).toBeInTheDocument(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-or-later | ||
| // Copyright (C) 2026 Steel-Tech / StructuPath | ||
| import { describe, it, expect } from "vitest"; | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { LegalDisclaimer } from "@/components/wizard/legal-disclaimer"; | ||
|
|
||
| describe("LegalDisclaimer", () => { | ||
| it("always shows the not-legal-advice notice", () => { | ||
| render(<LegalDisclaimer stateCode="WA" />); | ||
| expect(screen.getByRole("note")).toHaveTextContent(/not legal advice/i); | ||
| }); | ||
|
|
||
| it("shows the last-verified date for a verified state", () => { | ||
| render(<LegalDisclaimer stateCode="WA" />); | ||
| expect(screen.getByRole("note")).toHaveTextContent(/last verified/i); | ||
| }); | ||
|
|
||
| it("flags a machine-generated state as not independently verified", () => { | ||
| render(<LegalDisclaimer stateCode="AL" />); | ||
| const note = screen.getByRole("note"); | ||
| expect(note).toHaveTextContent(/not independently verified/i); | ||
| expect(note).not.toHaveTextContent(/last verified/i); | ||
| }); | ||
|
|
||
| it("renders a generic notice when no state is known", () => { | ||
| render(<LegalDisclaimer stateCode={null} />); | ||
| expect(screen.getByRole("note")).toHaveTextContent(/not legal advice/i); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| "use client"; | ||
|
|
||
| // SPDX-License-Identifier: AGPL-3.0-or-later | ||
| // Copyright (C) 2026 Steel-Tech / StructuPath | ||
| import { ShieldAlert } from "lucide-react"; | ||
| import { getStateVerification } from "@/content/state-registry"; | ||
|
|
||
| interface LegalDisclaimerProps { | ||
| /** Two-letter state code from the user's profile, if known. */ | ||
| stateCode?: string | null; | ||
| } | ||
|
|
||
| /** Format an ISO date (YYYY-MM-DD) without UTC timezone drift. */ | ||
| function formatVerifiedDate(iso?: string): string { | ||
| if (!iso) return ""; | ||
| const [y, m, d] = iso.split("-").map(Number); | ||
| if (!y || !m || !d) return iso; | ||
| return new Date(y, m - 1, d).toLocaleDateString("en-US", { | ||
| year: "numeric", | ||
| month: "short", | ||
| day: "numeric", | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Persistent, non-dismissable legal notice shown on state-facing content. | ||
| * Surfaces whether the state's regulatory data was human-verified (with the | ||
| * date) or is machine-generated and unverified. | ||
| */ | ||
| export function LegalDisclaimer({ stateCode }: LegalDisclaimerProps) { | ||
| const v = stateCode ? getStateVerification(stateCode) : null; | ||
| const agency = v?.stateName ?? "your state"; | ||
|
|
||
| return ( | ||
| <div | ||
| role="note" | ||
| aria-label="Legal disclaimer" | ||
| className="flex items-start gap-2.5 rounded-lg border border-neon-amber/25 bg-neon-amber/5 px-3.5 py-2.5 text-xs leading-relaxed" | ||
| > | ||
| <ShieldAlert className="mt-0.5 h-4 w-4 shrink-0 text-neon-amber" /> | ||
| <div className="space-y-1 text-text-secondary"> | ||
| <p> | ||
| <span className="font-semibold text-neon-amber">Not legal advice.</span>{" "} | ||
| Fees, rules, and links change — verify with the official {agency}{" "} | ||
| agency before acting. | ||
| </p> | ||
| {v && | ||
| (v.verified ? ( | ||
| <p className="text-text-muted"> | ||
| Last verified {formatVerifiedDate(v.lastVerified)}. | ||
| {v.sourceUrl && ( | ||
| <> | ||
| {" "} | ||
| <a | ||
| href={v.sourceUrl} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="text-neon-blue hover:underline" | ||
| > | ||
| Source | ||
| </a> | ||
| </> | ||
| )} | ||
| </p> | ||
| ) : ( | ||
| <p className="text-text-muted"> | ||
| Auto-generated for {v.stateName} — not independently verified. | ||
| {v.sourceUrl && ( | ||
| <> | ||
| {" "} | ||
| <a | ||
| href={v.sourceUrl} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="text-neon-blue hover:underline" | ||
| > | ||
| Confirm with the state agency | ||
| </a> | ||
| </> | ||
| )} | ||
| </p> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user downloads JSON to preserve or audit their wizard progress, this builder serializes
summary.phaseSummariesrather thanuserState.progress, so the file only has per-phase counts and loses every visited step id andcompletedChecklistitem id. Two different users can produce identical exports even though they checked different items, making the progress export unrecoverable/incomplete; include the step-level progress (or rawuserState.progress) in the JSON payload.Useful? React with 👍 / 👎.