fix(forms): stop long pathway step codes overflowing the decision context#742
fix(forms): stop long pathway step codes overflowing the decision context#742BigSimmo wants to merge 12 commits into
Conversation
…text
The before/parallel/after lists in the decision-context card render the
step code in a fixed-width column. `pathwayItems` keeps the raw string as
the code when it looks like a form code, which includes qualified codes
like "6B attachment" (e.g. form 6B's parallel step), so the code cell
overflowed into the title.
Render only the split head ("6B") in that compact cell via a new
PathwayStepCode helper (reusing the shared splitFormCode) with truncation
and a full-code tooltip; the adjacent title column already carries the
full label, so nothing is lost.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughPathway codes on the form detail page now render compact heads, with optional qualifiers exposed through tooltips and assistive text in the Before, Parallel, and After pathway lists. ChangesPathway code rendering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/forms/form-detail-page.tsx (1)
206-221: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winExpose the full pathway code in the tooltip.
When
codeis6B attachment, using onlyqualifierfortitleshowsattachmentand omits the displayed head. This does not satisfy the stated behavior of providing the full code via tooltip.Proposed fix
- title={qualifier ?? undefined} + title={qualifier ? code.trim() : undefined}🤖 Prompt for 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. In `@src/components/forms/form-detail-page.tsx` around lines 206 - 221, Update PathwayStepCode so its title exposes the complete original code whenever a tooltip is needed, including both head and qualifier for values such as “6B attachment”; preserve the existing head-only display and avoid adding a tooltip when no qualifier exists.
🤖 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.
Outside diff comments:
In `@src/components/forms/form-detail-page.tsx`:
- Around line 206-221: Update PathwayStepCode so its title exposes the complete
original code whenever a tooltip is needed, including both head and qualifier
for values such as “6B attachment”; preserve the existing head-only display and
avoid adding a tooltip when no qualifier exists.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 965e4f3a-e52f-4396-9a97-dc41c856665a
📒 Files selected for processing (1)
src/components/forms/form-detail-page.tsx
|
Re: CodeRabbit's "expose the full pathway code in the tooltip" comment — no change needed; the current code already does this. title={qualifier ? `${head} ${qualifier}` : undefined}So for Generated by Claude Code |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/forms/form-detail-page.tsx (1)
205-220: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winExpose the full pathway code to assistive technology.
The compact element displays only
head, while the qualified code is available only throughtitle, which is not reliably exposed to screen readers or keyboard/touch users. FollowFormCodeBadge’s existing pattern by adding a visually hidden full-code label (and marking the decorative truncated spanaria-hidden).🤖 Prompt for 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. In `@src/components/forms/form-detail-page.tsx` around lines 205 - 220, Update PathwayStepCode to expose the complete code by adding a visually hidden label containing the full code, following FormCodeBadge’s accessibility pattern. Mark the truncated span that renders head as aria-hidden so assistive technology uses the full-code label instead of the decorative compact text.
🤖 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.
Outside diff comments:
In `@src/components/forms/form-detail-page.tsx`:
- Around line 205-220: Update PathwayStepCode to expose the complete code by
adding a visually hidden label containing the full code, following
FormCodeBadge’s accessibility pattern. Mark the truncated span that renders head
as aria-hidden so assistive technology uses the full-code label instead of the
decorative compact text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f5e27430-21d0-4249-8b47-488b5dbd37bb
📒 Files selected for processing (1)
src/components/forms/form-detail-page.tsx
PathwayStepCode showed only the split head ("6B") visually, leaving the
full code reachable only via the title tooltip, which assistive tech does
not reliably announce. Add an sr-only full-code label and mark the
decorative head aria-hidden, matching FormCodeBadge's pattern, so screen
readers get "6B attachment" while the compact visual is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #3145 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Pull request was closed
Summary
Final piece of the form-code overflow cleanup (after #728 and #734). The decision-context "Pathway" card on the form detail page renders each before/parallel/after step code in a fixed-width column.
pathwayItemskeeps the raw string as the code when it matches a form-code shape — which includes qualified codes like6B attachment(form 6B lists it as a parallel step) — so the code cell overflowed into the title.PathwayStepCodehelper that renders only the split head (6B) in the compact code cell, reusing the sharedsplitFormCodefromform-code-badge.titletooltip; the adjacent title column already shows the full label, so no information is lost and the compact list styling is preserved.Scope note: presentational only — one component (
form-detail-page.tsx), no data/routing/retrieval/answer/governance behaviour touched. The full step label remains visible in the title column and via tooltip.Verification
npx eslint src/components/forms/form-detail-page.tsx— cleannpx prettier --check— cleannode scripts/check-type-scale.mjs --strict— passesnpx vitest run tests/forms.test.ts tests/forms-clipboard-fallback.test.ts— 6/6 passnpm run typecheck— no new errors in the changed file (pre-existing failures are missing@testing-library/@axe-core/playwrightdev deps intests/, identical on base)/forms/form-6bdecision-context, whose parallel step is6B attachment— the code cell now shows6Bwith6B attachmentin the title column, fully contained;1A/6A/Steprows unaffectednpm run verify:uigate requires@axe-core/playwright, not installed in this environment; verified visually with the pre-installed Chromium viaplaywright-coreinstead.Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Clinical de-escalation) already resolve to theStephead, so they render unchanged.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit