Rebuild the page's controls with Carbon web components (#70) #71

Open
chris-kreidl wants to merge 1 commit from 70-carbon-controls into main
chris-kreidl commented 2026-11-13 18:57:38 +00:00 (Migrated from github.com)

🤖 Claude: Closes #70

The page's controls are now IBM Carbon web components, in Carbon's light (g10) and dark (g100) themes, chosen by the system setting. The #67 layout is unchanged.

What changed

  • Controls: cds-button (primary, ghost, tertiary), cds-checkbox for sectors, cds-number-input for market cap, a cds-slider with value-upper (the two-handle slider) each for ROTC and EY, cds-inline-notification in the notice band, and cds-progress-bar in the pipeline steps. They are registered in web/carbon.ts.
  • Table: still a native <table>, now with Carbon's data table classes (--sm --sort --zebra) and Carbon's sort buttons. The sticky header is our own position: sticky, because Carbon's sticky variant turns the table into blocks. Our sorting and re-ranking are unchanged.
  • Styles: @carbon/styles' compiled CSS is 1.2 MB and loads IBM Plex from IBM's CDN, which would undo #67's self-hosted fonts. So scripts/carbon-css.ts generates web/carbon.css from it with only what the page uses: Carbon's :root tokens, the g10/g100 themes and the data table rules (81 KB). Rerun the script after upgrading @carbon/styles. web/style.css now handles layout only and uses only Carbon tokens.
  • Telemetry: Carbon's postinstall (ibmtelemetry) is blocked because the packages aren't in trustedDependencies (bun add reported "Blocked 21 postinstalls"). CLAUDE.md documents IBM_TELEMETRY_DISABLED=true.
  • Docs: DESIGN.md, .impeccable/design.json and the page brief now describe the Carbon-based system. CLAUDE.md mentions the Carbon packages.

Things worth a look

  • The two-handle slider (unstable) works with mouse and keyboard in Chrome and in happy-dom. Three things to know about it:

    • Handles stop at each other. Before, the other handle moved along. This is how Carbon's slider works, and min ≤ max still holds. The test now checks this behaviour.
    • Positions are 1-based. Carbon treats an upper value of 0 as "no upper handle".
    • Carbon leaves both handles unnamed, so the page names them ("Minimum ROTC", "Maximum ROTC") inside the shadow root.

    A metric with fewer than two distinct values disables its slider. Before, only zero values did, and with one value the slider couldn't filter anything anyway.

  • The slider hides its end labels. ROTC runs to 418,220%, which overflowed the rail. The Min/Max readouts under each track still say "any" at the ends, and the handle tooltips show values.

  • The filter rail is 304px instead of 264px. Carbon's number input is at least 9.375rem wide, so two side by side need the room.

  • A step's Run button is named "Run " through visually hidden text. Carbon doesn't pass aria-label through to its inner button.

  • Carbon logs a one-time [@carbon/feature-flags] notice about enable-v12-autoalign, in tests and in the browser console. I left the flag alone.

Definition of Done

  • Acceptance criteria met and demonstrated:

    • Layout: same as #67, checked at 1440px and 700px wide.
    • Controls: all of the listed controls are Carbon components.
    • Table: native, with a sticky header (verified while scrolled) and Carbon sort buttons.
    • Themes: they follow the system setting. I checked dark in Chrome; light is token-driven from the same file, but I didn't look at it in a browser.
    • Keyboard: slider keys, the Run buttons, checkboxes and the sort buttons all work.
    • Telemetry: kept off.
    • Docs: updated.
  • bun test passes: 329 pass, 0 fail, three runs in a row. First task done: Lit components work in happy-dom, with one catch. happy-dom drops the attributes of elements upgraded after the fact, so the test imports web/carbon.ts before any markup. test/app.test.ts drives the real components: clicks inside their shadow roots, typing into the number inputs, and arrow keys on the slider handles.

  • bun check is clean, and bun fmt --check --changed=origin/main passes. web/carbon.css is generated, so it's in the fmt ignorePatterns.

  • Runs end to end on real data: bun run web against the local company_facts.db (1,391 companies). In Chrome:

    • Filters: the sector, market cap and slider filters re-rank the table, and Clear filters resets everything.
    • Sorting: works, with the header staying put while the table scrolls.
    • Notices: a refused start shows as a warning (with fetch stubbed in the page, so no job ran).
    • Console: no errors.

    I didn't start a real pipeline run from the page.

  • Stand-up posted on the milestone tracking issue when the story started and when this PR opened. I missed the start-of-story stand-up again; the ready-for-review one is posted on #51.

  • Open product questions: none new.

🤖 Generated with Claude Code

🤖 **Claude:** Closes #70 The page's controls are now IBM Carbon web components, in Carbon's light (g10) and dark (g100) themes, chosen by the system setting. The #67 layout is unchanged. ### What changed - **Controls**: `cds-button` (primary, ghost, tertiary), `cds-checkbox` for sectors, `cds-number-input` for market cap, a `cds-slider` with `value-upper` (the two-handle slider) each for ROTC and EY, `cds-inline-notification` in the notice band, and `cds-progress-bar` in the pipeline steps. They are registered in `web/carbon.ts`. - **Table**: still a native `<table>`, now with Carbon's data table classes (`--sm --sort --zebra`) and Carbon's sort buttons. The sticky header is our own `position: sticky`, because Carbon's sticky variant turns the table into blocks. Our sorting and re-ranking are unchanged. - **Styles**: `@carbon/styles`' compiled CSS is 1.2 MB and loads IBM Plex from IBM's CDN, which would undo #67's self-hosted fonts. So `scripts/carbon-css.ts` generates `web/carbon.css` from it with only what the page uses: Carbon's `:root` tokens, the g10/g100 themes and the data table rules (81 KB). Rerun the script after upgrading `@carbon/styles`. `web/style.css` now handles layout only and uses only Carbon tokens. - **Telemetry**: Carbon's `postinstall` (`ibmtelemetry`) is blocked because the packages aren't in `trustedDependencies` (`bun add` reported "Blocked 21 postinstalls"). CLAUDE.md documents `IBM_TELEMETRY_DISABLED=true`. - **Docs**: DESIGN.md, `.impeccable/design.json` and the page brief now describe the Carbon-based system. CLAUDE.md mentions the Carbon packages. ### Things worth a look - **The two-handle slider (unstable)** works with mouse and keyboard in Chrome and in happy-dom. Three things to know about it: - **Handles stop at each other.** Before, the other handle moved along. This is how Carbon's slider works, and min ≤ max still holds. The test now checks this behaviour. - **Positions are 1-based.** Carbon treats an upper value of `0` as "no upper handle". - **Carbon leaves both handles unnamed**, so the page names them ("Minimum ROTC", "Maximum ROTC") inside the shadow root. A metric with fewer than two distinct values disables its slider. Before, only zero values did, and with one value the slider couldn't filter anything anyway. - **The slider hides its end labels.** ROTC runs to 418,220%, which overflowed the rail. The Min/Max readouts under each track still say "any" at the ends, and the handle tooltips show values. - **The filter rail is 304px instead of 264px.** Carbon's number input is at least 9.375rem wide, so two side by side need the room. - **A step's Run button is named "Run <step>"** through visually hidden text. Carbon doesn't pass `aria-label` through to its inner button. - **Carbon logs a one-time `[@carbon/feature-flags]` notice** about `enable-v12-autoalign`, in tests and in the browser console. I left the flag alone. ### Definition of Done - [x] Acceptance criteria met and demonstrated: - **Layout**: same as #67, checked at 1440px and 700px wide. - **Controls**: all of the listed controls are Carbon components. - **Table**: native, with a sticky header (verified while scrolled) and Carbon sort buttons. - **Themes**: they follow the system setting. I checked dark in Chrome; light is token-driven from the same file, but I didn't look at it in a browser. - **Keyboard**: slider keys, the Run buttons, checkboxes and the sort buttons all work. - **Telemetry**: kept off. - **Docs**: updated. - [x] `bun test` passes: 329 pass, 0 fail, three runs in a row. First task done: Lit components work in happy-dom, with one catch. happy-dom drops the attributes of elements upgraded after the fact, so the test imports `web/carbon.ts` before any markup. `test/app.test.ts` drives the real components: clicks inside their shadow roots, typing into the number inputs, and arrow keys on the slider handles. - [x] `bun check` is clean, and `bun fmt --check --changed=origin/main` passes. `web/carbon.css` is generated, so it's in the fmt `ignorePatterns`. - [x] Runs end to end on real data: `bun run web` against the local `company_facts.db` (1,391 companies). In Chrome: - **Filters**: the sector, market cap and slider filters re-rank the table, and Clear filters resets everything. - **Sorting**: works, with the header staying put while the table scrolls. - **Notices**: a refused start shows as a warning (with `fetch` stubbed in the page, so no job ran). - **Console**: no errors. I didn't start a real pipeline run from the page. - [ ] Stand-up posted on the milestone tracking issue when the story started and when this PR opened. I missed the start-of-story stand-up again; the ready-for-review one is posted on #51. - [x] Open product questions: none new. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
socket-security[bot] commented 2026-11-13 18:57:52 +00:00 (Migrated from github.com)

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​carbon/​web-components@​2.67.0901009299100
Added@​carbon/​styles@​1.119.09410010097100

View full report

**Review the following changes in direct dependencies.** Learn more about [Socket for GitHub](https://socket.dev?utm_medium=gh). <table> <thead> <tr> <th>Diff</th> <th width="200px">Package</th> <th align="center" width="100px">Supply Chain<br/>Security</th> <th align="center" width="100px">Vulnerability</th> <th align="center" width="100px">Quality</th> <th align="center" width="100px">Maintenance</th> <th align="center" width="100px">License</th> </tr> </thead> <tbody> <tr><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/diff-added.svg" title="Added" alt="Added" width="20" height="20"></a></td><td><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930">@​carbon/​web-components@​2.67.0</a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/score-90.svg" title="Supply Chain Security" width="40" height="40" alt="90"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Vulnerability" width="40" height="40" alt="100"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/score-92.svg" title="Quality" width="40" height="40" alt="92"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/score-99.svg" title="Maintenance" width="40" height="40" alt="99"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972650930"><img src="https://github-app-statics.socket.dev/score-100.svg" title="License" width="40" height="40" alt="100"></a></td></tr> <tr><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/diff-added.svg" title="Added" alt="Added" width="20" height="20"></a></td><td><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844">@​carbon/​styles@​1.119.0</a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/score-94.svg" title="Supply Chain Security" width="40" height="40" alt="94"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Vulnerability" width="40" height="40" alt="100"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/score-100.svg" title="Quality" width="40" height="40" alt="100"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/score-97.svg" title="Maintenance" width="40" height="40" alt="97"></a></td><td align="center"><a href="https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies&dependency_item_key=101972651844"><img src="https://github-app-statics.socket.dev/score-100.svg" title="License" width="40" height="40" alt="100"></a></td></tr> </tbody> </table> [View full report](https://socket.dev/dashboard/org/chris-kreidl/diff-scan/06e90fc8-f500-4df0-a42a-ace13638fbae?tab=dependencies) <!-- overview-comment -->
claude[bot] commented 2026-11-13 18:58:30 +00:00 (Migrated from github.com)

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

## Code review No issues found. Checked for bugs and CLAUDE.md compliance.
chris-kreidl commented 2026-11-20 23:50:34 +00:00 (Migrated from github.com)

/review

/review
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '70-carbon-controls:70-carbon-controls'
git switch '70-carbon-controls'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff '70-carbon-controls'
git switch '70-carbon-controls'
git rebase 'main'
git switch 'main'
git merge --ff-only '70-carbon-controls'
git switch '70-carbon-controls'
git rebase 'main'
git switch 'main'
git merge --no-ff '70-carbon-controls'
git switch 'main'
git merge --squash '70-carbon-controls'
git switch 'main'
git merge --ff-only '70-carbon-controls'
git switch 'main'
git merge '70-carbon-controls'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/screener!71
No description provided.