Skip to content

fix(forms): truncate long pathway step codes in decision context#816

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/form-pathway-code-overflow-5ca9
Jul 18, 2026
Merged

fix(forms): truncate long pathway step codes in decision context#816
cursor[bot] merged 3 commits into
mainfrom
cursor/form-pathway-code-overflow-5ca9

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stops long pathway step codes (for example 6B attachment) overflowing the fixed-width decision-context columns on the form detail page.
  • Renders only the short form-code head visually, with the full code exposed via sr-only text and a title tooltip (same pattern as FormCodeBadge).
  • Aligns splitFormCode with pathwayItems by splitting on any whitespace (/\s+/), including tabs, so qualifier extraction stays consistent.
  • Fresh rebase of fix(forms): stop long pathway step codes overflowing the decision context #742 onto current main.

Verification

  • Diff limited to form pathway truncation + splitFormCode whitespace alignment
  • npm run test -- tests/form-code-badge.test.ts (1 passed, includes 6B\tattachment)
  • UI verification not run: presentational truncation helper; hosted Production UI covers forms journeys
  • Hosted CI: Static / Unit / Production UI as required by change scope

Risk and rollout

  • Risk: low — presentational truncation of pathway step codes + shared code-split helper whitespace
  • Rollback: revert this squash merge
  • Provider or production effects: None

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 sjrfecxgysukkwxsowpy (Clinical KB Database)
  • 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

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes
    • Improved pathway step code display in the Before, Parallel, and After sections with consistent truncation, accessibility-friendly full-code exposure, and tooltips when qualifiers are present.
    • Enhanced form code splitting so qualifiers are correctly separated even when spacing includes tabs, newlines, or multiple spaces.
  • Tests
    • Added coverage to verify form code splitting across common whitespace formats and qualifier/no-qualifier cases.

Show only the short form-code head in the fixed-width pathway column
so qualifiers like "6B attachment" cannot overflow, while keeping the
full code available via sr-only text and title tooltip.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabase Bot commented Jul 18, 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 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The form detail page adds whitespace-aware code splitting and accessible truncation for qualified pathway step codes in the Before, Parallel, and After pathway lists.

Changes

Pathway code display

Layer / File(s) Summary
Pathway step code helper and splitting
src/components/forms/form-code-badge.tsx, tests/form-code-badge.test.ts, src/components/forms/form-detail-page.tsx
splitFormCode recognizes any whitespace separator and is tested with spaces, tabs, newlines, trimming, and unqualified codes. PathwayStepCode displays the head while exposing qualified codes through screen-reader text and a tooltip.
Pathway list integration
src/components/forms/form-detail-page.tsx
The Before, Parallel, and After pathway lists render codes with PathwayStepCode.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and matches the main change: truncating long pathway step codes in decision context.
Description check ✅ Passed The description follows the required template and includes summary, verification, risk, governance, and notes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/form-pathway-code-overflow-5ca9

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

@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/form-detail-page.tsx`:
- Around line 210-212: Update splitFormCode, used by PathwayStepCode, to
recognize the same whitespace separators as pathwayItems, including tabs and
other \s+ matches, so qualifier extraction and fullCode tooltip rendering remain
consistent. Add a regression test covering a value such as “6B\tattachment” and
verify the qualifier is included.
🪄 Autofix (Beta)

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: afb0e8ac-44c9-43ae-8c23-2d85b348c9a7

📥 Commits

Reviewing files that changed from the base of the PR and between bf3c855 and a6d4adf.

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

Comment thread src/components/forms/form-detail-page.tsx
@cursor
cursor Bot enabled auto-merge (squash) July 18, 2026 06:41
BigSimmo and others added 2 commits July 18, 2026 14:42
Align splitFormCode with pathwayItems' /\s+/ separator so tab/newline
qualifiers still truncate to the short head and keep the full-code tooltip.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot merged commit 54229f0 into main Jul 18, 2026
17 checks passed
@cursor
cursor Bot deleted the cursor/form-pathway-code-overflow-5ca9 branch July 18, 2026 07:00
cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
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