Skip to content

Upgrade Ant Design to 6.6.1 and fix visual regressions - #608

Merged
marceloarocha merged 3 commits into
developfrom
claude/antd-version-bump-hv4xj4
Aug 31, 2026
Merged

Upgrade Ant Design to 6.6.1 and fix visual regressions#608
marceloarocha merged 3 commits into
developfrom
claude/antd-version-bump-hv4xj4

Conversation

@marceloarocha

Copy link
Copy Markdown
Collaborator

Summary

Upgrades Ant Design from 6.2.1 to 6.6.1 and applies targeted CSS fixes to maintain visual consistency across the application. Adds a visual regression test harness for future UI-affecting dependency bumps.

Key Changes

  • Dependency upgrade: Ant Design 6.2.1 → 6.6.1

  • CSS fixes for antd 6.3+ layout changes:

    • Spin component: restore inherited font-size/line-height to prevent typography inheritance issues
    • Collapsed menu items: adjust icon vertical alignment (flexbox centering vs. inline layout)
    • Button icons: restore previous rendering by removing inline-flex centering and ::before strut
    • Shadow token: configure boxShadowTertiary to maintain card/popup appearance
  • Component selector updates for antd 6.3+ DOM changes:

    • .ant-tabs-tabpane.ant-tabs-content (Screening, Patient styles)
    • .ant-tabs-tabpane-hidden.ant-tabs-content-hidden
    • .ant-tabs-content.ant-tabs-body (tab container wrapper)
    • .ant-spin-nested-loading.ant-spin (DataViewer)
    • .ant-select-content-value.ant-select-content-has-value (Prioritization)
  • Checkbox styling: Updated selectors to target new antd 6.3+ DOM structure (.ant-checkbox instead of .ant-checkbox-inner)

  • Test updates: Fixed modal footer button selectors in permission/config tests (.ant-modal-footer scope added for specificity)

  • Visual regression test suite: Added tests/mocked/visual.antd.spec.ts — a local-only harness for pixel-by-pixel comparison of UI changes across dependency bumps. Includes frozen timestamps, fixture hydration, and baseline snapshots (gitignored, machine-specific).

Implementation Details

  • All CSS fixes are backward-compatible and scoped to prevent side effects
  • Visual test suite is skipped in CI (baselines are machine-specific due to font rasterization)
  • Fixture-based mocking ensures deterministic rendering across test runs
  • No breaking changes to component APIs or behavior

https://claude.ai/code/session_01RTmKkYCb6gwApZuQ1Sg5jb

claude added 2 commits August 25, 2026 16:03
Re-applies the antd 6.6.1 upgrade, this time verified pixel-by-pixel
against 6.2.1 baselines: full-page screenshots of the login,
prioritization (cards, patients, prescriptions, expanded advanced
filter), screening (drugs tab, checked state, interventions tab),
interventions list and admin exams (list + modal) pages were captured on
6.2.1 and the upgraded pages now render pixel-identical to all of them.

Class renames handled (custom overrides/queries retargeted):
- Tabs: ant-tabs-content/-holder -> ant-tabs-body/-holder;
  ant-tabs-tabpane(-hidden) -> ant-tabs-content(-hidden), including the
  Screening keyboard-navigation querySelectors.
- Checkbox: ant-checkbox-inner removed; border/background live on
  ant-checkbox itself.
- Select: ant-select-content-value merged into
  ant-select-content-has-value on the content element.
- Spin: the nested wrapper ant-spin-nested-loading is now ant-spin.

Rendering changes in antd >= 6.3 that broke page layouts, counteracted
in Reboot.jsx / ConfigProvider so everything keeps the 6.2 look:
- The Spin wrapper now sets font-size/line-height, so whole page bodies
  (most pages render inside a Spin) inherited antd's 1.5714 line-height
  instead of the app's 1.15 and every block below shifted/grew. Restored
  inheritance on wrappers that contain an ant-spin-container.
- Button icons are now centered inline-flex with an \00a0 ::before strut
  that redefines the icon baseline, nudging every in-button icon glyph
  ~1-3px. Restored the inline rendering and removed the strut.
- The collapsed sider menu lays items out with flexbox, centering each
  icon 1px lower; compensated on the icon.
- boxShadowTertiary got darker; pinned the previous value via the
  ConfigProvider theme token.

Also scopes the mocked e2e "Fechar" modal locators to the footer since
antd 6.6 adds an aria-labelled close button to modal headers.

Verified: tsc + vite build passes, eslint clean (0 errors, pre-existing
warnings only), full mocked e2e suite 52/52, and an 11-page visual
regression suite matches the 6.2.1 baselines exactly.
Screenshots 11 page states (prioritization, screening, interventions,
admin, login) with a frozen clock and fixed fixture dates so two runs are
pixel-comparable. Record baselines with --update-snapshots before a bump,
re-run after it to diff. Baselines are machine-specific, so the snapshot
directory is gitignored and the suite skips itself in CI.

@amazon-q-developer amazon-q-developer 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.

The Ant Design upgrade from 6.2.1 to 6.6.1 with corresponding CSS fixes appears well-executed. The changes appropriately address DOM structure changes introduced in Ant Design 6.3+ through targeted CSS selector updates and theme token adjustments. The addition of a visual regression test suite provides valuable tooling for future dependency upgrades. All changes maintain backward compatibility and no blocking defects were identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@marceloarocha
marceloarocha merged commit b5ea5df into develop Aug 31, 2026
8 checks passed
@marceloarocha
marceloarocha deleted the claude/antd-version-bump-hv4xj4 branch August 31, 2026 19:10
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