Skip to content

chore: upgrade vite-plus to 0.1.20 and fix surfaced a11y violations#15

Draft
fengmk2 wants to merge 1 commit into
mainfrom
update-vite-plus-0.1.20
Draft

chore: upgrade vite-plus to 0.1.20 and fix surfaced a11y violations#15
fengmk2 wants to merge 1 commit into
mainfrom
update-vite-plus-0.1.20

Conversation

@fengmk2
Copy link
Copy Markdown
Owner

@fengmk2 fengmk2 commented May 9, 2026

Summary

Upgrade vite-plus and related packages from 0.1.16 to 0.1.20 (latest stable), and fix the 14 WCAG AA color-contrast violations the upgrade exposed.

Package upgrade

  • package.json: vite-plus0.1.20, vitest (aliased to @voidzero-dev/vite-plus-test) → 0.1.20
  • pnpm-workspace.yaml overrides: vite (aliased to @voidzero-dev/vite-plus-core) and vitest0.1.20
  • pnpm-lock.yaml: regenerated via pnpm install

Why a11y tests started failing

After bumping vite-plus, test/nuxt/a11y.spec.ts reported 14 new axe color-contrast violations across LinkBase, CodeFileTree, DiffLine, DiffSkipBlock, DiffTable, DiffSidebarPanel, and DiffMobileSidebarDrawer. The same tests pass on main with vite-plus@0.1.16.

The strongest candidate for the behavior change is upstream vitest vitest-dev/vitest#10049fix(browser): spread user server options into browser Vite server in project — merged 2026-04-07, shipped in vitest@4.1.4:

createBrowserServer passes project.options into createViteServer(), but the nested server block was replaced with a fresh object containing only hmr and watch. This caused user settings like server.https, server.host, and server.cors to be silently dropped.

Vite-plus alpha bundles vitest:

  • vite-plus@0.1.16vitest@4.1.2 (without the fix)
  • vite-plus@0.1.20vitest@4.1.5 (with the fix)

Before the fix, user server.* options (including the ones Nuxt + UnoCSS rely on for serving generated CSS modules in browser-mode tests) were silently dropped, so styles weren't fully applied to the test DOM and axe defaulted to plain black-on-white. After the fix, the same options reach the browser-mode Vite server, the styled colors actually render, and axe correctly flags pre-existing AA contrast issues. The violations are real and pre-date this PR; the upgrade only stops masking them.

a11y fixes (real source-level)

Component Fix
app/components/Link/Base.vue Disabled buttons: drop opacity-50 + text-fg/bg-fg (effective 3.69:1) for text-fg-muted / bg-fg-muted design tokens (~8:1) and add aria-disabled="true"
app/components/Diff/SidebarPanel.vue Stat numbers and semver badges: text-{green,red,yellow,purple}-500text-{...}-700 dark:text-{...}-400 (matches existing Alert.vue convention)
app/components/Diff/MobileSidebarDrawer.vue Same color-shade swap on the mobile drawer's stats line
app/components/Diff/SkipBlock.vue Drop the redundant opacity-50text-fg-muted on bg-bg-muted already meets contrast
app/components/Diff/Line.vue Line-number cell: text-fg-subtle (5.5:1+) instead of opacity-50 over inherited text (3.69:1)
app/assets/main.css Light-mode --accent default oklch(0.5 0.16 247.27) (was 0.53). Lifts text-accent on bg-fg/10 from 4.19 to ~5:1. Users with a custom --accent-color are unaffected

Test plan

  • pnpm test --project nuxt test/nuxt/a11y.spec.ts440/440 pass
  • Full pnpm test → all suites pass except test/unit/server/utils/image-proxy.spec.ts (DNS check on example.com — environmental, also fails on main, passes on CI runners)
  • CI green

Note

Medium Risk
Moderate risk due to the vite-plus/vitest toolchain upgrade (and lockfile regen) which can affect build/test behavior; UI changes are limited to color/disabled-state styling and should be low impact functionally.

Overview
Upgrades the Vite toolchain by bumping vite-plus (and the vitest alias/overrides) from 0.1.16 to 0.1.20, updating workspace overrides and regenerating pnpm-lock.yaml accordingly.

Fixes newly-surfaced WCAG contrast/a11y issues by adjusting theme tokens and component styles: tweaks light-mode --accent, increases contrast for diff stats/badges and line numbers, removes extra opacity in skip blocks, and updates Link/Base.vue disabled rendering (adds aria-disabled and switches to muted colors for better contrast).

Reviewed by Cursor Bugbot for commit d3edb93. Configure here.

@fengmk2 fengmk2 self-assigned this May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

e18e dependency analysis

No dependency warnings found.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the vite-plus and vitest dependencies from version 0.1.16 to 0.1.20 across the project's configuration files. The changes include extensive updates to the pnpm-lock.yaml file, reflecting new versions for core packages such as oxlint, oxfmt, and oxc-project components, while also explicitly incorporating esbuild into several dependency snapshots. As there are no review comments to assess, I have no feedback to provide.

@fengmk2 fengmk2 changed the title chore: upgrade vite-plus to 0.1.20 chore: upgrade vite-plus to 0.1.20 and fix surfaced a11y violations May 9, 2026
@fengmk2
Copy link
Copy Markdown
Owner Author

fengmk2 commented May 9, 2026

@codex review

@fengmk2
Copy link
Copy Markdown
Owner Author

fengmk2 commented May 9, 2026

@cursor review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 9, 2026

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

Upgrade vite-plus and related packages from 0.1.16 to 0.1.20 (latest
stable), and fix the 14 WCAG AA color-contrast violations that the
upgrade exposed in test/nuxt/a11y.spec.ts.

The strongest candidate for the behavior change is upstream
vitest-dev/vitest#10049 ("fix(browser): spread user server options into
browser Vite server in project"), shipped in vitest@4.1.4. Before that
fix, createBrowserServer silently dropped user server.* options, so the
browser-mode Vite server didn't fully serve UnoCSS-generated CSS and
axe defaulted to plain black-on-white. After it, styles render
correctly and axe surfaces pre-existing contrast issues. vite-plus
0.1.16 bundles vitest 4.1.2 (without the fix); 0.1.20 bundles 4.1.5
(with it). The violations are real and pre-date this PR — the upgrade
only stops masking them.

Source-level a11y fixes:
- LinkBase: disabled buttons drop opacity-50 + text-fg/bg-fg (3.69:1)
  for text-fg-muted / bg-fg-muted tokens (~8:1) and add aria-disabled.
- DiffSidebarPanel + DiffMobileSidebarDrawer: stats and semver badges
  use text-{green,red,yellow,purple}-700 dark:text-{...}-400, matching
  the existing Alert.vue convention.
- DiffSkipBlock: drop redundant opacity-50; text-fg-muted on
  bg-bg-muted already meets contrast.
- DiffLine: line-number cell uses text-fg-subtle (5.5:1+) instead of
  opacity-50 over inherited text (3.69:1).
- main.css: light-mode --accent default oklch(0.5 0.16 247.27) so
  text-accent on bg-fg/10 reaches ~5:1 (was 4.19); user-set
  --accent-color overrides remain unaffected.
@fengmk2 fengmk2 force-pushed the update-vite-plus-0.1.20 branch from 56ba6ae to d3edb93 Compare May 9, 2026 08:39
@fengmk2
Copy link
Copy Markdown
Owner Author

fengmk2 commented May 9, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d3edb93. Configure here.

@fengmk2
Copy link
Copy Markdown
Owner Author

fengmk2 commented May 9, 2026

Visual comparison — a11y fixes

Both captures taken on this branch (vite-plus 0.1.20) so the test environment is identical between
BEFORE and AFTER — only the CSS toggles. Captured via vitest browser-mode page.screenshot() on isolated
component mounts (with browser.ui: false so the tester iframe isn't scaled down).

1. LinkBase disabled buttons

opacity-50 on text-fg / bg-fg (3.69:1) → text-fg-muted / bg-fg-muted design tokens (~8:1) +
aria-disabled="true".

BEFORE (failing AA) AFTER (passes AA)
1-link-base-disabled 1-link-base-disabled

2. DiffMobileSidebarDrawer stats line

text-{green,red,yellow}-500 on white (1.91–3.80:1) → text-{...}-700 dark:text-{...}-400 matching the
existing Alert.vue convention.

BEFORE AFTER
3-diff-mobile-drawer 3-diff-mobile-drawer

3. DiffSkipBlock "n unchanged lines"

Removed redundant opacity-50text-fg-muted on bg-bg-muted already meets contrast (2.41:1 → ~8:1).

BEFORE AFTER
4-diff-skip-block

4. DiffLine line numbers

opacity-50 over inherited text (3.69:1) → text-fg-subtle (5.5:1+). Subtle delta — line-number "10"
goes from washed-out to readable.

BEFORE AFTER
5-diff-line 5-diff-line

5. CodeFileTree selected file

Light-mode --accent default oklch(0.53 → 0.5) so text-accent on bg-fg/10 clears AA (4.19 → ~5:1).
User-set --accent-color overrides remain unaffected.

BEFORE AFTER
6-code-file-tree-selected 6-code-file-tree-selected

Not pictured: DiffSidebarPanel (the desktop sibling of #2) reuses the same
text-green/red/yellow-500 → -700 swap and the same text-purple-500 → -700 semver-badge swap. It
mounts in isolation but the right-aligned colored stats / major / minor / patch badges only surface
once the panel is wired into a real flex layout, so the standalone capture doesn't render them. The fix
is identical to #2.

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