Skip to content

(experiment) modernize Primer controls to match GitHub App - #8734

Draft
siddharthkp wants to merge 28 commits into
mainfrom
siddharthkp-match-shortcut-button-padding
Draft

siddharthkp wants to merge 28 commits into
mainfrom
siddharthkp-match-shortcut-button-padding

Conversation

@siddharthkp

@siddharthkp siddharthkp commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

No linked issue: draft visual-modernization experiment.

Bring GitHub App's newer visual treatment into Primer React's Button, ActionMenu, TextInput, Dialog, main-export SelectPanel, ToggleSwitch, and experimental KeybindingHint. Preserve existing state, keyboard, accessibility, and public API contracts, along with Primer icons and semantic light/dark/high-contrast palettes.

The project contract and review loop are documented in component-modernization.md.

Changelog

New

  • Compact ToggleSwitch sizing, small Dialog density, and a visually hidden SelectPanel title that retains its accessible name.
  • Content-matched comparison stories for the four-component batch.
  • Separate stacked, live comparison pages with GitHub App on the left, Primer on the right, one shared theme selector, and reset.

Changed

  • Component-scoped typography, geometry, spacing, and interaction styling.
  • Individual KeybindingHint keycaps with Button and ActionList contextual styling.
  • SelectPanel preserves custom overlay styles and explicit maximum-height limits.
  • Every TextInput size example includes a leading visual.

Removed

None. No replacement Kbd/KbdChord exports, deprecated SelectPanel2 migration, grouped virtualization, global shortcut-visibility behavior, or dependency installation.

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

Draft styling experiment; production rollout decisions are deferred until visual review. Published changes are covered by component-specific changesets.

Testing & Reviewing

Local review pages require the current reference Storybook on 6008, this repository's Storybook on 6007, and the comparison server on 6009:

Component Live comparison
Dialog http://localhost:6009/compare-dialog.html
SelectPanel http://localhost:6009/compare-select-panel.html
ToggleSwitch http://localhost:6009/compare-switch.html
KeybindingHint / Kbd http://localhost:6009/compare-kbd.html

All examples are vertically stacked, use equal iframe widths, and link to their source stories. Reference fixture changes remain local to the reference worktree and were not committed or pushed there.

Passing checks

  • npm run build && npm test -- --run: passed, 163 files / 3,109 tests; 3 skipped and 10 todo.
  • npm run build: passed again after the final SelectPanel maximum-height and Dialog icon/focus corrections.
  • npx --no-install vitest run --project '@primer/react' packages/react/src/SelectPanel/SelectPanel.test.tsx packages/react/src/Dialog/Dialog.test.tsx packages/react/src/ToggleSwitch/ToggleSwitch.test.tsx packages/react/src/KeybindingHint/KeybindingHint.test.tsx packages/react/src/ActionMenu/ActionMenu.test.tsx packages/react/src/Button/Button.test.tsx: passed, 5 matching files / 345 tests.
  • npx --no-install vitest run --project '@primer/react' packages/react/src/SelectPanel/SelectPanel.test.tsx: passed after the final correction, including the explicit maximum-height regression.
  • npx --no-install vitest run --project '@primer/react' packages/react/src/Dialog/Dialog.test.tsx: passed after the final correction.
  • npx --no-install tsc --noEmit -p packages/react/tsconfig.json: passed.
  • npm run lint, npm run lint:css, npm run lint:md, and npm run format:diff: passed.
  • STORYBOOK_URL=http://localhost:6007 npx --no-install playwright test e2e/components/{Dialog,SelectPanel,ToggleSwitch,KeybindingHint,Button,ConfirmationDialog}.test.ts --grep @avt --workers=2: passed, 8 matching KeybindingHint tests. The other selected files contain no matching @avt cases.

Additional browser checks verified all 64 comparison story renders, actual light/dark/high-contrast theme changes on both sources, equal-width stacked layout, and reset restoring both switch states. Dialog popup dimensions and all 15 SelectPanel width/height pairs were measured against the running reference. Long and virtualized lists scroll the final option into view using the keyboard and commit it with Enter; modal selection commits with Save. Small Dialog close controls match the reference's 28px button / 16px icon; Escape restores the comparison trigger's focus through the existing returnFocusRef API. Narrow Dialog and SelectPanel popups remain inside a 360px viewport.

Baseline limitations

  • npm run type-check: fails locally in the existing generated Next.js validator at examples/nextjs/.next/dev/types/validator.ts:51, which imports missing src/app/underlinenav/page.js. React package checking passes; no unrelated example/cache changes were made.
  • Supplemental accessibility scanning covered 32 Primer fixtures in four themes: 112 of 128 scans passed; 16 SelectPanel scans failed. Findings are scrollable-region-focusable, native-radio labels, and nested interactive elements. These reproduce in existing overflowing/virtualized and single-select-modal stories. Keyboard scrolling and selection were separately verified without forcing scrolling; rules were not disabled to produce a passing result.
  • GitHub reports this existing PR as CONFLICTING / DIRTY against main. Pull-request CI, including canonical Linux visual baselines, cannot start until those conflicts are resolved. The update snapshots label was refreshed after pushing, but no snapshot run was scheduled. No unrelated main-branch merge or conflict resolution was attempted.

Intentional differences remain visible on the comparison pages: accessible opaque placeholders, Primer artwork and palettes, always-visible switch labels/indicators, existing modifier ordering, spinner-only loading, and existing modal radio/Cancel/Save semantics.

siddharthkp and others added 9 commits November 9, 2026 23:27
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the active ButtonBase stylesheet and component to main while retaining the modern stylesheet for a future override layer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the original stylesheet unchanged and the full modern reference unused. Apply a small CSS Module layer for all-size spacing while preserving inline Link sizing and joined keyboard hints.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 179ca67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

siddharthkp and others added 4 commits November 10, 2026 15:47
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot requested a deployment to storybook-preview-8734 November 10, 2026 14:52 Abandoned
siddharthkp and others added 2 commits November 10, 2026 15:55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot requested a deployment to storybook-preview-8734 November 10, 2026 15:01 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8734 November 10, 2026 15:25 Inactive
@siddharthkp siddharthkp changed the title ignore (experiment) bring modern styles for button Nov 11, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@siddharthkp siddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
siddharthkp and others added 5 commits November 15, 2026 00:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@siddharthkp siddharthkp changed the title (experiment) bring modern styles for button (experiment) modernize Primer controls to match GitHub App Nov 14, 2026
@siddharthkp siddharthkp added update snapshots 🤖 Command that updates VRT snapshots on the pull request and removed update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Nov 14, 2026
siddharthkp and others added 5 commits November 15, 2026 00:56
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Correct Dialog comparison primary actions and refine switch geometry, disabled colors, and size alignment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch was successfully deployed

2 active (outdated) deployments
storybook-preview-8734 — d5d7628c Deployed Nov 13, 2026 by github-actions[bot]
github-pages — d5d7628c Deployed Nov 13, 2026 by siddharthkp via deploy-preview #34300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member update snapshots 🤖 Command that updates VRT snapshots on the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant