Skip to content

fix(forms): contain long form codes in result badge and elevate design#728

Merged
BigSimmo merged 4 commits into
mainfrom
claude/form-sizing-design-8hebku
Jul 17, 2026
Merged

fix(forms): contain long form codes in result badge and elevate design#728
BigSimmo merged 4 commits into
mainfrom
claude/form-sizing-design-8hebku

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes the badge sizing bug. Form codes carrying a trailing qualifier — e.g. 6B Attachment / 1A attachment — overflowed the fixed-size result badge because the whole string rendered at text-2xl, spilling the qualifier word out of the chip and over the title column (the reported screenshot).
  • Introduces a FormCodeBadge that splits the code into a prominent head (6B) and a compact, fully-contained qualifier sub-label (ATTACHMENT), and scales the head font down as the code lengthens (1Atext-2xl, 10Atext-xl, longer → text-base) so no code ever clips. Applied consistently to the desktop results table and the mobile cards.
  • Design elevation: the badge is now a gradient, inset-shadowed chip; result rows gain a subtle accent rail plus colour transition on hover; the Open control gains a hover affordance (border/fill on row hover, chevron nudge).
  • The qualifier sub-label uses the named text-4xs type-scale step (not an arbitrary size), keeping it on the design scale.

Scope note: this is a purely presentational change to one component. It is classified clinical-risk only because the filename forms-search-results-page.tsx contains "search"; the Clinical Governance Preflight below is completed on that basis, and every listed invariant is genuinely untouched by the diff. No data, routing, retrieval, answer, ingestion, or governance behaviour changed, and test ids / rendered text are unchanged so existing specs keep passing.

Verification

  • npx eslint src/components/forms/forms-search-results-page.tsx — clean
  • npx prettier --check on the file — clean
  • node scripts/check-type-scale.mjs --strict — passes (no arbitrary font sizes)
  • npx vitest run tests/forms.test.ts — 5/5 pass
  • npm run typecheck — no new errors from this change (pre-existing failures are all missing @testing-library/@axe-core/playwright dev deps in tests/, identical on the base branch)
  • Browser QA via Playwright screenshots against the running dev server at desktop (1360px) and mobile (420px) on the attachment query, which surfaces the 1A/6B/12C Attachment forms — badge is fully contained at both breakpoints
  • UI verification not run: the npm run verify:ui gate requires @axe-core/playwright, which is not installed in this environment; verified visually with the pre-installed Chromium via playwright-core instead.

Risk and rollout

  • Risk: low — isolated presentational change to a single component (forms-search-results-page.tsx); no behavioural, data, or API surface touched.
  • Rollback: revert the two commits on this branch; no migrations or state changes involved.
  • Provider or production effects: None / not applicable.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Notes

  • The qualifier reads in full on desktop (ATTACHMENT); on the narrower mobile chip it truncates with an ellipsis and carries a title tooltip with the full text.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Improved form code display across desktop results and mobile cards with a unified badge layout.
    • Code headings now scale by badge size and code length for clearer readability.
    • Optional qualifiers are shown as uppercase sub-labels, with truncation to avoid overflow.
    • Updated desktop/mobile grid spacing by adjusting the first column width for tighter alignment.
    • Enhanced the “Open” link icon with a subtle hover animation for a more responsive feel.

Form codes such as "6B Attachment" / "1A attachment" overflowed the
fixed-size result badge because the whole code rendered at text-2xl,
spilling the qualifier word out of the chip and over the title column.

Introduce a FormCodeBadge that splits the code into a prominent head
("6B") and a compact, contained qualifier sub-label ("Attachment"), and
scales the head font down as the code lengthens so longer codes never
clip. Applied consistently to the desktop results table and the mobile
cards.

Also elevate the results surface: a gradient, inset-shadowed badge chip,
a subtle accent rail and colour transition on row hover, and a hover
affordance on the Open control.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL
@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 344e4b0e-cc52-449b-a09f-6f057942918c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)

❌ Error creating Unit Test PR.

  • Create PR with unit tests
  • Commit unit tests in branch claude/form-sizing-design-8hebku

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo marked this pull request as ready for review July 17, 2026 17:29
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

The result-badge qualifier sub-label used an arbitrary text-[0.5rem]
utility, which the strict type-scale gate rejects. --text-4xs is the
named 0.5rem step, so swap to text-4xs for an identical rendering that
stays on the design scale.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/forms/forms-search-results-page.tsx`:
- Around line 107-118: Update the code rendering around the head and qualifier
spans so accessibility text exposes one complete code value in the intended
order, rather than concatenating adjacent fragments without separation. Preserve
the visual head/qualifier styling, mark those visual fragments as hidden from
the accessibility tree, and add a single accessible text node for the full code
so whole-code text queries continue to work.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 68a61ddd-be1d-4ae7-8c9f-1c9bed5689e6

📥 Commits

Reviewing files that changed from the base of the PR and between a185a59 and 8883289.

📒 Files selected for processing (1)
  • src/components/forms/forms-search-results-page.tsx

Comment thread src/components/forms/forms-search-results-page.tsx Outdated
claude and others added 2 commits July 17, 2026 17:34
The badge renders the code as two visual spans (head + qualifier), which
assistive tech and text queries would read concatenated ("6BAttachment").
Add an sr-only node carrying the full "6B Attachment" string and mark the
decorative visual fragments aria-hidden, so the code is announced and
queryable as one value while the split styling is preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL
@BigSimmo
BigSimmo enabled auto-merge July 17, 2026 17:38
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Request timed out after 900000ms (requestId=3291ab96-2396-4b60-adc8-30cfb087da60)

@BigSimmo
BigSimmo merged commit 554df30 into main Jul 17, 2026
15 checks passed
@BigSimmo
BigSimmo deleted the claude/form-sizing-design-8hebku branch July 17, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants