Skip to content

Fix parameter search result layout and filter legibility - #1173

Merged
PavelMakarchuk merged 5 commits into
mainfrom
fix/parameter-search-ui
Aug 26, 2026
Merged

Fix parameter search result layout and filter legibility#1173
PavelMakarchuk merged 5 commits into
mainfrom
fix/parameter-search-ui

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Contributor

Three fixes to the flagship parameter search, all visible on /us/build.

Result rows

gov.irs.credits.ctc.refundable.social_security.add has a list of variable names as its value. The value column had no width limit and nowrap, so it took the row and left the label its longest-word width — "Child Tax Credit added social security taxes" rendered one word per line.

The label column now gets flex: 1 with min-width: 0 so it can ellipsize instead of collapsing, and the value is capped at 45% with the full text on hover.

State filter

The scope dropdown listed UT only, VT only, WA only. It now names states — "Utah", "Vermont", "Washington" — sorted by name under a "States" group, with "All jurisdictions" and "Federal only" above.

The names come from metadata.economy_options.region via a new getStateLabels selector, so this is the model's own label rather than a checked-in list, and it works for any country. A state the metadata does not name falls back to its uppercase code.

Contributed filter

"Contributed" named a filter without saying what it filtered. An info tooltip now explains: policy options contributed to the model — proposed reforms and experimental provisions that are not current law.

The trigger sits outside the <label> deliberately; inside it, clicking the icon would toggle the filter.

Testing

Verified in the running app — the row renders on one line with the value truncated, the dropdown reads "Alabama … Wyoming", and the tooltip shows on hover. Four new tests cover the named dropdown, the code fallback, and the tooltip text; 16 pass in ParameterSearchBox.test.tsx, 322 across the flagship and libs suites. Typecheck and eslint clean.

🤖 Generated with Claude Code

Three things the search surface got wrong:

A result row gave its value column unlimited width, so a list-valued
parameter (a dozen variable names) starved the label beside it and
stacked "Child Tax Credit added social security taxes" one word per
line. The label now holds its row and the value truncates, with the
full text on hover.

The scope filter listed states as "UT only". It now names them —
"Utah" — read from the model's own region labels rather than a name
list, falling back to the code when metadata does not name one.

"Contributed" named a filter without saying what it filtered. An
adjacent tooltip explains that these are proposed reforms and
experimental provisions rather than current law.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-calculator-next Ready Ready Preview Aug 26, 2026 1:23pm
policyengine-website Ready Ready Preview Aug 26, 2026 1:23pm

Request Review

Search is the surface people came for; the tree is the fallback for when
you don't know what the parameter is called. Fourteen agency names sat
above the fold arguing otherwise.

The search box now sits centered in the workspace with the tree behind a
toggle, which drops the vertical centering and expands in place when
opened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Search shows only the leaves that matched, so a folder header names a
folder whose other members are invisible — exactly when someone has
landed near what they wanted rather than on it.

Folder headers are now buttons: clicking one opens the tree, expands the
ancestor chain to that folder and scrolls it into view. The results stay
up so the near miss can be compared against what the folder holds.

Adding stays per-parameter. A folder can hold dozens, and a reform that
silently touches all of them is not what clicking a header meant.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The draft follows you across Ask, Build and Reforms, and at full height
it takes the rail on every one of them — fine while you are editing it,
in the way while you are looking for the next parameter.

The header is now a toggle. Folded, it keeps the heading and the
provision count, so the draft is still visibly there; everything
editable goes away. It opens by default, since a draft nobody notices is
the thing this panel exists to prevent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@PavelMakarchuk
PavelMakarchuk merged commit 0a07ca5 into main Aug 26, 2026
12 checks passed
@PavelMakarchuk
PavelMakarchuk deleted the fix/parameter-search-ui branch August 26, 2026 13:27
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.

1 participant