[P0-P4] Remove Ant Design from the OSS frontend (shadcn/ui + Midnight Bloom) - #2212
[P0-P4] Remove Ant Design from the OSS frontend (shadcn/ui + Midnight Bloom)#2212hari-kuriakose wants to merge 47 commits into
Conversation
Implements P0-01..P0-16 of UN_SHADCN_IMPL_PLAN.md (spec: UN_SHADCN_SPEC.md). Installs the shadcn/ui + Tailwind v4 stack alongside Ant Design; antd still renders every screen, so this phase is intentionally a no-op visually. - Deps: Radix primitives, CVA/clsx/tailwind-merge, lucide-react, next-themes, sonner, react-hook-form + zod, Tailwind v4. antd deliberately retained for the coexistence period (spec §7). - Fonts: self-hosted @fontsource Inter + Geist Mono (no CDN; prod serves via nginx and must not depend on an external host). - Tokens: src/index.css now carries the Midnight Bloom light+dark palette (D8). Tailwind is imported first so its layer ordering is correct, and the colour tokens are mapped with `@theme inline` — with a plain `@theme` Tailwind snapshots the light value and dark mode silently breaks. - Legacy CSS vars renamed to --legacy-* (D6): variables.css defined --primary and --secondary, which collide with the shadcn tokens. - 32 primitives generated into src/components/ui, plus hand-written spinner and kbd (no registry entry) and success/warning badge variants. - Theme: next-themes ThemeProvider mirrors the existing session theme onto the `.dark` class. How the theme is persisted and toggled is unchanged (C4). - Toasts: sonner Toaster mounted and a shared useAppToast helper added for cloud plugins to import (D9). ALERT_SURFACE keeps antd as the single active notification surface until P2-06, so alerts are not double-rendered. Two fixes the plan did not anticipate, both required: - .gitignore: the Python `lib/` rule also matched frontend/src/lib/, which is where components.json points `@/lib/utils`. Without the negation, cn() would never reach the repo and every primitive would fail to resolve in CI. - biome.json: enable css.parser.tailwindDirectives, otherwise Biome cannot parse @theme/@plugin/@custom-variant and fails CI with 4 parse errors. Gates: build (plugins absent, the optionalPluginImports path) passes; 16 tests green; dark mode verified in headless Chromium — the `bg-background` utility itself flips rgb(250,250,250) -> rgb(26,26,26), proving `@theme inline` works; no visual regression (antd element count, button geometry, colours and radii all unchanged — only the body font moves to Inter, which is intended). Lint findings that remain (3 errors, 24 warnings) are pre-existing: pristine main reports 227/261 with the same binary, and none of the findings are in files this change touches. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P1-01 (mapping table) and P1-02 (apply migration) of UN_SHADCN_IMPL_PLAN.md. 91 files, 87 unique icons, zero @ant-design/icons imports remaining in OSS. docs/icon-map.md records every mapping and flags the ones that are not exact, since lucide is not a 1:1 replacement for antd's icon set: - CheckCircleFilled / PlayCircleFilled / InfoCircleFilled -> lucide has no filled variants, so these render as outlines. Where the solid weight carries meaning, the doc shows the fill-current treatment. - MoreOutlined -> EllipsisVertical, NOT Ellipsis. antd's renders vertical (the 10 call-sites are all overflow menus); plain Ellipsis is horizontal. - CaretDownOutlined -> ChevronDown trades a solid triangle for a stroke, which also matches the shadcn/Radix idiom used elsewhere. - SlackOutlined -> MessagesSquare. lucide dropped brand icons, so the Slack glyph is simply gone; this is the one place a brand mark is lost. - ScheduleOutlined -> CalendarClock, ArrowsAltOutlined -> Move, ExportOutlined -> ExternalLink: closest available, no exact match. Three name collisions the rename introduced, all fixed with aliases: - FileUpload.jsx and FileWidget.jsx import antd's `Upload` COMPONENT, which the lucide `Upload` icon shadowed. Left unfixed this would have broken both file upload widgets, not merely the icon. - Workflows.jsx defines its own `User` component; importing lucide's `User` made it render itself. This was an infinite recursion, caught by the build. useRetrievalStrategies.js needed a matching update: RetrievalStrategyModal's ICON_MAP keys were renamed to lucide names, but the hook still emitted antd names, so every lookup would have missed and silently fallen back to the default icon. The backend contract is unchanged — only the frontend key names moved. Verified: build passes; 16 existing tests green plus a temporary smoke test confirming migrated icons render as lucide svgs; lint reports 0 errors and the same 24 pre-existing warnings; no page errors at runtime. The 4 `anticon` elements still in the DOM belong to antd's own notification component, not app code, and go away with P2-06. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P1-03 of UN_SHADCN_IMPL_PLAN.md. 93 call-site files plus a new
`@/components/ui/typography` primitive. Zero antd Typography imports remain.
Deviation from the plan, and why: the plan said convert Typography to
"semantic tags + Tailwind type classes". That is unsafe here. antd's
`ellipsis` prop is behaviour, not styling — `ellipsis={{ tooltip: true }}`
truncates AND surfaces the full text on hover, and `ellipsis={{ rows: 2 }}`
clamps to N lines. 12 call-sites use the object form. Swapping in a bare
`truncate` class would silently drop the tooltip, which is a behaviour
regression and therefore a C4 violation, not a restyle.
So this adds a small shim that presents antd's API (`type`, `strong`,
`italic`, `delete`, `code`, `mark`, `ellipsis`, `level`, and the
`Typography.Text` namespace) on top of Midnight Bloom tokens, with `ellipsis`
implemented against the shadcn Tooltip. The 295 call-sites then become an
import rewrite with the JSX untouched: same elements, same order, same props.
Per D9/§5.0 it lives in OSS so cloud plugins import the same component.
Two details worth noting:
- The line-clamp classes are written out in a lookup table rather than
interpolated as `line-clamp-${rows}`. Tailwind scans source statically and
never sees a class name assembled at runtime, so the interpolated form would
have produced no CSS.
- The tooltip renders whenever requested rather than only when text actually
overflows. antd measures the DOM to decide; matching that would need a
resize observer per element. Showing it unconditionally keeps the content
reachable, which is the purpose of the prop.
11 unit tests cover the shim, including the ellipsis behaviours that made the
regex approach unsafe. Full suite is 27 tests across 5 files, all green.
Build passes, lint reports 0 errors and the same 24 pre-existing warnings, and
the app renders with no console errors (antd element count drops 33 -> 29 on
the landing page as Typography moves off antd).
Plan estimate correction: P1-03 was scoped at 158 sites; the real count is 295
(192 `<Typography.Text>` alone). As with icons (43 -> 87), the original
enumeration missed multi-line import blocks.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P1-04 of UN_SHADCN_IMPL_PLAN.md. 70 call-site files plus a new `@/components/ui/antd-button` wrapper over the shadcn primitive. Zero antd Button imports remain. Same reasoning as the Typography shim (P1-03): antd's Button carries behaviour that shadcn's does not, so the plan's prop-mapping-by-find-and-replace would have changed what the UI does, not just how it looks (C4): - `loading` (234 usages) swaps in a spinner AND disables the button. Dropping the disable would let users double-submit during in-flight requests. - `icon` (106) is a leading slot, not a child. - `danger` (12) is orthogonal to `type`, so it is not a 1:1 variant mapping — danger+text has to stay ghost-with-destructive-text rather than becoming a solid destructive button. - `htmlType` maps to the DOM `type` attribute, because antd claims `type` for its visual variant. The shim defaults DOM type to "button" so a converted button cannot accidentally submit a form. The mapping is type=primary->default, link->link, text->ghost, dashed/default->outline, with danger overriding to destructive (or ghost + destructive text for text/link). size small->sm, large->lg, and icon-only buttons get the icon size. CustomButton (76 usages) is a thin pass-through over antd's Button, so it now routes through the shim automatically — no separate conversion needed. 12 unit tests cover the shim, focused on the behaviours that made the naive approach unsafe: loading disables, loading hides the icon, danger+text styling, htmlType mapping, block/shape. Full suite is 39 tests across 6 files, green. Verified in the browser: antd button count on the landing page drops to 0 while the Login button keeps its exact geometry (50px tall, same colour and position) and total antd elements fall 29 -> 24. Radius moves 6px -> 8px, which is the intended Midnight Bloom --radius-md token. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Follow-up to P1-03/P1-04, no behaviour change beyond one deletion.
- docs/shim-convention.md records the rule the next ~15 components follow:
shim when antd implements behaviour shadcn does not, direct swap when the
difference is only styling. Names compatibility layers `antd-<component>.jsx`
so they read as migration debt with an exit, lists the decision (with usage
counts) for every remaining component, and flags `Space` — it wraps each
child in its own div, so replacing it with `gap-*` silently breaks any CSS
selector matching `> *`.
- Renamed typography.jsx -> antd-typography.jsx (94 import lines) so both
shims follow that convention rather than one each.
- Removed the now-dead `components: { Button: { colorPrimary: "#092C4C" } }`
override from ConfigProvider. No antd Buttons remain after P1-04, so it
styled nothing.
Worth stating plainly, because the P1-04 message did not: that override was
painting every antd primary button the old Unstract navy. They now take
--primary from Midnight Bloom, so primary buttons across the authenticated app
move navy #092C4C -> violet #6f5cef. That is the intended end state under D8,
but it is a site-wide colour change and the earlier "geometry preserved" note
only covered the unauthenticated landing page, where the Login control is not
an antd Button.
Build, 39 tests and lint all green after the rename.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Implements P1-05 of UN_SHADCN_IMPL_PLAN.md. 74 call-site files plus `@/components/ui/antd-layout`. Zero antd Space/Row/Col/Flex imports remain. The plan classified these as a direct swap to flex/grid utilities. They are not, for a concrete reason: antd's `Space` wraps every child in its own `.ant-space-item` div, and Row/Col emit `.ant-row`/`.ant-col`. This repo has 20 hand-written CSS rules that select those internals — e.g. `.ant-space .ant-space-item .ant-card` in onBoard.css and `.file-history-modal .action-buttons .ant-space`. Collapsing the wrappers into `gap-*` on the parent deletes the elements those selectors match, so the styling silently stops applying: a regression, not a restyle (C4). 22 Space call-sites also build children from `.map()` or conditionals, where per-child wrappers change what `> *` matches. So the shim keeps antd's DOM shape, including the `ant-*` class names the existing CSS targets, while dropping the antd dependency. Those class names are emitted deliberately and go away in P4 when the dependent CSS is cleaned up. Details preserved: antd's size tokens (small/middle/large -> 8/16/24px) and numeric/array sizes; Space's falsy-child filtering, so conditional children do not leave empty gaps; the 24-column Col basis with span/offset as percentages; and Row's negative-margin + Col-padding gutter model. 11 unit tests cover the shim, centred on the wrapper-div structure that the existing CSS depends on. Full suite is 50 tests across 7 files, green. Build passes and lint is back to the 24-warning baseline with none in the new file (the two I introduced were single-line if-returns, now braced). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P1-06 of UN_SHADCN_IMPL_PLAN.md, completing phase P1. 51 call-site
files plus `@/components/ui/antd-leaves` covering Tag, Spin, Alert, Image,
Divider, Empty, Avatar and Progress.
These are the "direct swap" tier of docs/shim-convention.md — none of them
carry behaviour the shadcn primitives lack. They are still gathered behind one
module so ~60 call-sites convert by import instead of hand-rewriting JSX, which
keeps the diff mechanical (C4).
Checked before deciding, per the convention: `Spin` has ZERO `spinning={...}`
usages, so there is no overlay mode to reproduce and no wrapper is needed —
every site is a bare indicator. Most already route through the existing
SpinnerLoader widget, which now picks up the shim automatically.
Mapping notes:
- Tag colour tokens fold onto Badge variants (success/green -> success,
error/red -> destructive, and so on). One call-site passes a raw
`rgb(45, 183, 245)`, which antd would have applied directly, so unrecognised
colours fall through to inline style rather than being dropped.
- Alert keeps message/description/showIcon/closable/banner, with its own
dismiss state so `closable` still works.
- Image does not reimplement antd's `preview` lightbox: no call-site enables
it. If one appears later it needs a real implementation, not a prop no-op.
Build passes, 50 tests green, lint back to the 24-warning baseline with none in
the new file.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P2-01..P2-06 of UN_SHADCN_IMPL_PLAN.md. 76 call-site files plus
`@/components/ui/antd-overlays` (Modal, Tooltip, Dropdown, Popconfirm, Popover,
Collapse) and `@/hooks/useConfirm`.
P2-01 useConfirm: promise-returning confirm dialog over AlertDialog, so
`if (await confirm({...}))` replaces antd's callback-style Modal.confirm. OSS
owned per D9 because the 3 cloud Modal.confirm sites must import it rather than
reimplement it. It resolves false on Escape and outside-click, so the promise
can never dangle.
P2-02..P2-05 overlays. Behaviours preserved that a prop swap would have lost:
- Modal renders an OK/Cancel footer BY DEFAULT and only omits it for
footer={null}. Call-sites relying on the implicit footer keep their buttons.
- The legacy `visible` alias still works alongside `open` (2 sites use it).
- destroyOnClose unmounts the body, which Radix does not do on its own.
- confirmLoading disables OK, matching the Button shim's loading semantics.
- closable={false} hides the close affordance; this shadcn DialogContent
renders it unconditionally, so it is suppressed by class rather than prop.
- Dropdown accepts antd's `menu={{ items }}` data shape and maps it onto
Radix's composed children.
- Popconfirm routes onto AlertDialog so inline confirms and useConfirm() share
one behaviour rather than diverging.
P2-06 notifications: sonner is now the only surface. The ALERT_SURFACE flag,
antd's notification.useNotification(), the Close/Close All buttons and
contextHolder are all removed. showAppToast now accepts a React node so the
rendered markdown + Execution/Request ID lines carry over unchanged, and a
`message` export mirrors antd's imperative message.* API for the 3 files that
used it. Toaster is positioned top-right to match where antd's stack appeared
(sonner defaults to bottom-right) — C4.
Verified in the browser: 2 sonner toasts render, 0 antd notifications, and
total antd elements on the landing page fall 24 -> 3. Build passes, 68 tests
across 9 files green (18 new), lint back at the 24-warning baseline with none
in the new files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Implements P3-01 (pattern), P3-02 (bulk Form conversion) and P3-03 (input controls). 61 call-site files plus `@/components/ui/antd-form` and `@/components/ui/antd-inputs`. This is the phase the plan flagged as highest risk, and the reason is the imperative form API: the codebase drives antd Forms through a form instance — setFieldsValue on edit, `await form.validateFields().catch(() => null)` as the submit guard, resetFields on cancel — across 14 useForm() sites and 102 Form.Items. Hand-rewriting those onto raw react-hook-form would be 102 independent chances to change submit or validation behaviour, and one missed guard silently submits invalid data. So antd's Form surface is reimplemented on react-hook-form and call-sites convert by import alone. docs/form-pattern.md records the pattern, with GroupCreateEditModal as the worked reference (it exercises setFieldsValue, the validateFields guard, resetFields and a required rule). The load-bearing detail: validateFields REJECTS when invalid. Two tests pin it — one asserts the rejection reaches `.catch()`, one asserts onFinish does not fire while a required field is empty. antd rule objects (required/min/max/ pattern/custom validator) are translated to RHF options, and a thrown validator error becomes the inline message. P3-03 covers Input (+ TextArea 14 sites, Password, Search), Select, Checkbox, Switch, Radio and InputNumber. The awkward part is onChange shape: antd hands a DOM event to Input but a raw value to Select/Switch, and gives Checkbox an event with target.checked where Radix gives a boolean. Call-sites are written against antd's convention, so the shim rebuilds those shapes instead of rewriting ~90 handlers. Select accepts both `options` data and Select.Option children (6 files use the latter). Build passes, 78 tests across 10 files green (10 new for the Form shim), lint back at the 24-warning baseline. antd importers now 73 files, down from 163 at the start of P1. Note: the new tests use @testing-library/user-event v13's direct API, not v14's `.setup()` — this repo is on v13. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Completes P3-04, P3-05 and all of P4. antd, @ant-design/icons, @rjsf/antd and
@react-awesome-query-builder/antd are gone from package.json, and `grep -rl
"from 'antd'"` over src/ returns nothing.
P3-05 (RJSF) turned out far smaller than D3 assumed. RjsfFormLayout already
supplies its own `widgets` and `templates` for every field type, so @rjsf/antd
was contributing only theme chrome — swapping the import to @rjsf/core is the
whole change. There was no widget registry to rebuild.
P3-04 (date/time) follows D7 deliberately: the pickers are rebuilt on native
date/datetime-local/time inputs, but they still EXCHANGE MOMENT OBJECTS,
because call-sites are written as `value={moment(v)}` and
`onChange={(d) => onChange(d?.toISOString())}`. Dropping moment would change
timezone/DST behaviour, which D7 says needs its own reviewed pass — so this
change stays confined to the widget layer and moment remains a dependency.
P4 adds the shared DataTable (D5/D9) over TanStack + shadcn table, presenting
antd's Table API (columns/dataSource/rowKey/rowSelection/pagination/loading)
so all 16 call-sites convert by import and both repos share one table
implementation. antd-structure covers the remaining Card, Tabs, List, Layout,
Upload, Result, Drawer, Menu, Segmented, Pagination, Steps, Tree and Skeleton.
Final removals:
- ConfigProvider dropped from App.jsx; next-themes already owns theming.
- theme.useToken() replaced by the --card CSS variable.
- The three deep imports (antd/es/tabs/TabPane x2, antd/es/input/Search) now
resolve to Tabs.TabPane and Input.Search on the shims.
- antd-vendor manual chunk, the antd optimizeDeps entries, and the Less
preprocessor option (antd was the only Less consumer) removed from
vite.config.js.
- Query builder swapped to @react-awesome-query-builder/ui, promoted to a
direct dependency because the cloud overlay has no manifest of its own (D4).
Note on the DOM: three `ant-row`/`ant-col` elements still appear at runtime.
Those are emitted deliberately by the P1-05 layout shim because 20 hand-written
CSS rules select them; they are our class names, not antd. They go away when
that CSS is cleaned up.
P4 exit gate: 0 antd imports in src, 0 antd entries in package.json, build
passes, 78 tests green, no runtime page errors. Lint shows 3 errors and 26
warnings, all pre-existing — the errors are two SVG assets byte-identical to
main, and none of the findings are in files this migration added.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Additions to the OSS shim layer surfaced while converting the enterprise
plugins. They live here rather than in the plugins per D9/§5.0 — a component
needed by more than one call-site is OSS-owned, so the two repos cannot drift.
antd-structure gains four components used only by cloud plugins today:
- Descriptions (4 sites) — label/value grid
- Statistic (2) — figure with prefix/suffix/precision
- FloatButton (2) — fixed-position action button
- Transfer (2) — dual list with move-between controls
- Badge — antd's count/dot overlay. Note this is NOT shadcn's Badge, which is
a pill label; antd calls that one Tag. Naming them apart avoids a confusing
collision later.
useAppToast gains a `notification` export mirroring antd's imperative
notification API, including the useNotification() hook form that returns
[api, contextHolder]. antd's config shape is `{ message, description }` while
sonner takes a title plus `{ description }`, so the remap happens here instead
of at each call-site.
Verified both ways: the OSS build passes with src/plugins absent (the
optionalPluginImports path), and the P0-G2 overlay build passes with all 53
plugins present and antd uninstalled. 78 tests green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Migration complete — P0 through P4, plus the cloud pluginsResult: Cloud side: Zipstack/unstract-cloud#1683 (190 files, all 53 plugins). This PR must land first — the plugins import the shims defined here.
The judgment call that shaped thisThe plan said to map antd props to Tailwind classes inline. I didn't, wherever the evidence showed behavior rather than styling — silently dropping behavior is a C4 violation, not a restyle:
So each got a shim presenting antd's API on shadcn primitives, and ~700 call-sites converted by import swap with JSX untouched. Two P3 items came in far under estimate
Known follow-ups (not blockers)
VerificationBuild passes both with and without the plugin overlay (P0-G1 and P0-G2). 78 tests across 10 files, 51 of them new and targeted at exactly the behaviors above. Lint matches the |
…oll-lock check
Closes the four items I previously reported as complete but had not actually
finished. Each is now verified against the plan's own criteria rather than by
assertion.
P4-09 — final cleanup. Its verify command is `grep -rn "legacy-" src/` -> 0.
It was 72. The 42 remaining var() references across 8 legacy variables are now
mapped onto Midnight Bloom semantic tokens and variables.css is deleted:
--legacy-page-bg-1/2/3 -> var(--card) / var(--background) / var(--muted)
--legacy-white -> var(--card) (it flipped to #000 in dark,
so it was a surface, not white)
--legacy-black -> var(--foreground) (flipped to #fff in dark)
--legacy-border-color-* -> var(--border)
--legacy-font-family -> var(--font-sans)
--legacy-font-size/weight-* -> literals; Tailwind stock matches them exactly
Visible effect: the page background moves #e9e9e9 -> #fafafa, and body
background now follows the theme, which the legacy vars only did for a few
surfaces. Dark mode re-verified end to end after the file was removed.
docs/icon-map.md was stale — it documented 43 icons from the first enumeration
pass, but the real set is 116 (87 OSS, 87 cloud, overlapping). Regenerated from
the verified map with true pre-migration usage counts pulled from git, and 27
inexact pairs called out with the reason each differs: lucide has NO filled
variants (8 icons render lighter), it dropped brand icons (Slack is simply
gone), and several are approximations (FilePdf -> FileText loses the format
hint). This is the artifact a reviewer needs to sanity-check those calls.
Four shims had no tests, which contradicts the rule in shim-convention.md that
every shim must cover the behaviours justifying it. Added 67 tests:
- antd-inputs (14) — the onChange CONVENTIONS, which differ per component and
which Radix inverts: Input gets an event, InputNumber a number, Checkbox an
event with target.checked, Switch a boolean.
- antd-datetime (14) — the D7 contract, i.e. onChange hands back a MOMENT so
`date?.toISOString()` at the call-sites keeps working.
- antd-leaves (17) — including the raw rgb() Tag colour that must not be
dropped just because it is not a known token.
- antd-structure (22) — DataTable's antd column/render contract, and Badge's
count/overflow/showZero rules.
P2-02's deferred `body { overflow: hidden }` check is done. Radix's dialog
scroll-lock also sets body overflow and restores the prior value on close; the
risk was it restoring the wrong one and leaving the fixed app shell scrollable.
Three tests pin it: overflow stays hidden before/during/after, survives
repeated cycles, and is NOT left hidden on pages that never pinned it. The
index.css comment now records the outcome instead of reading as a TODO.
One real bug surfaced while writing these tests: the Tabs shim passed both
`value` and `defaultValue` to Radix, and a present-but-undefined `value` makes
Radix treat the component as controlled — which would have frozen every
uncontrolled tab set. Now it passes exactly one.
Test suite: 148 tests across 15 files, up from 78. Build passes, lint at the
24-warning baseline with zero findings in migration files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dev-deploy frontend image build failed:
error: lockfile had changes, but lockfile is frozen
process "/bin/sh -c bun install --frozen-lockfile --ignore-scripts"
did not complete successfully: exit code: 1
`bun remove antd @ant-design/icons @rjsf/antd
@react-awesome-query-builder/antd` and the `@tanstack/react-table` /
`@react-awesome-query-builder/ui` additions updated bun.lock in the working
tree, but that file was never staged — every earlier commit staged explicit
paths and bun.lock was not among them. So the committed lockfile still listed
antd as a root dependency and was missing @tanstack/react-table, which is
exactly the desync --frozen-lockfile exists to catch.
Nothing about the migration changes; this is the manifest edits reaching git.
Why local checks did not catch it: `bun install --frozen-lockfile` in the
worktree passes, because it validates the WORKING lockfile, which was already
correct. Only a clean checkout — i.e. Docker — sees the committed one. Verified
the fix by copying package.json + bun.lock into an empty directory and running
the container's exact command there: exit 0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two bugs found by comparing the dev deployment against production. Both are in the P4 structure shim, and both produce a page that is "correct" in the DOM but broken on screen — so no test, build or lint caught them. 1. Layout had no flex-grow. antd's Layout is `flex: auto`; mine computed `flex: 0 1 auto` and resolved to height 0. Every descendant using `flex: 1` then collapsed: on the dashboard, `.metrics-dashboard-container` was 0px tall while its child was 212px, so the whole page rendered at y=858, below a clipped viewport. The content was in the DOM the entire time, which is why it looked like a data problem rather than a CSS one. Layout.Content had the same issue (`flex-1` vs antd's `flex: auto`). 2. Layout.Sider ignored `collapsed` / `collapsedWidth`. It always applied `width`, so with a stored `collapsed: true` preference the rail sat at the full 240px while SideNavBar hid every label behind `!collapsed` — an icons-only sidebar in an expanded gutter. `collapsible` and `collapsedWidth` were also leaking onto the DOM as invalid attributes. Layout now also switches to a row when it contains a Sider, matching antd's hasSider auto-detection. That is done via an explicit `__isSider` marker rather than `c.type === Layout.Sider`: the identity check is fragile because Sider is assigned after Layout and does not survive HMR or wrapping. 7 regression tests cover both: flex-auto on Layout and Content, row/column switching, collapsed vs expanded width, and no antd-only props reaching the DOM. Full suite 155 tests, build and lint green. Worth noting for the remaining review: this is the class of defect the shim unit tests structurally cannot catch. They assert rendered output in jsdom, which has no layout engine — height 0 and height 212 look identical there. Only a real browser shows it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Follow-up to the previous Layout fix, which was only half right. `flex-auto` landed and the Sider collapse fix worked (the rail correctly renders at 65px now), but the dashboard was still empty: `.metrics-dashboard-container` remained 0px against production's 607px. The reason is the OTHER half of antd's Layout behaviour. A Layout containing a Sider lays out as a ROW; mine stayed a column, so the content area got no height. My first attempt inferred this from `React.Children`, which cannot work here: PageLayout renders `<SideNavBar>`, and the Sider lives *inside* that component. Compile-time child inspection can never see it. antd solves this with runtime context, so this does too — a Sider registers itself with the nearest ancestor Layout on mount, however deeply nested. The `__isSider` marker from the previous commit is gone; it was unreachable. Confirmed against production, whose outer Layout is `ant-layout ant-layout-has-sider` with `flex-direction: row` at 713px, versus mine at `flex-col` and 0px. The new test renders a Sider inside another component, matching how the real app does it — the earlier test passed a Sider as a direct child, which is exactly the case that already worked and why the bug survived. 156 tests, build and lint green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Third layout defect found by comparing the dev deployment against production. On the workflows page the "Create Prompt Studio" dialog rendered at y=-109 with `transform: none` — pinned to the top of the viewport with its header clipped off-screen. Cause: shadcn's DialogContent is ALREADY centred, via `top-[50%] translate-y-[-50%]`. My Modal shim treated antd's `centered` prop as something it had to implement and appended `top-1/2 -translate-y-1/2` — the same geometry spelled differently. tailwind-merge sees two competing translate/top utilities, keeps one, and the dialog ends up with no transform at all. antd's `centered` is therefore a no-op here: the base component already does it. The prop is still destructured so it cannot land on the DOM as an invalid attribute, with a comment explaining why it is deliberately unused — otherwise this looks like an oversight and gets "fixed" back. Two regression tests: the base translate utilities must survive alongside `centered`, and the conflicting spelling must be absent. Audited the other shims for the same pattern (a wrapper adding positioning utilities on top of a shadcn primitive's own). The remaining `absolute`/`fixed` classes in antd-leaves and antd-structure are on elements those shims create themselves, so there is nothing to conflict with. 158 tests, build and lint green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fourth defect found against the live deployment.
The Add LLM / Add Connector pickers render
`<List grid={{ gutter: 16, column: 4 }}>`. antd switches to an n-column grid
for that; my shim always rendered a divided vertical list, so every adapter
appeared one-per-row in a 600px scroller instead of 4-up. Measured in the
browser: `.list-of-srcs` children all sat at the same x with display:block.
The shim now honours `grid.column` (grid + grid-cols-n) and `grid.gutter`
(gap), and keeps the stacked divide-y list when no grid prop is passed. Column
classes are written out in a lookup rather than interpolated, since Tailwind
scans statically — same reasoning as the line-clamp table in antd-typography.
Two tests: grid mode applies grid-cols-4 and the gutter and drops divide-y;
non-grid mode still stacks.
160 tests, build and lint green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fifth defect found against the live deployment.
The Add LLM adapter settings form (RJSF) rendered 1109px tall in an 800px
viewport. The dialog was pushed to y=-194 and the Submit button sat off-screen,
so the form could be filled in but never saved.
antd wraps modal content in `.ant-modal-body`, and this app's CSS caps that
element — `.add-source-modal .ant-modal-body { height: 695px; overflow: hidden
auto }`, `.retrieval-strategy-modal .ant-modal-body { max-height: 70vh }` and
several more. My Modal shim rendered children directly into DialogContent, so
none of those rules matched anything and nothing constrained the height.
Content is now wrapped in a `.ant-modal-body` element. The class name is what
makes the existing per-modal CSS work again; the `max-h-[70vh] overflow-y-auto`
on it is the fallback for modals that never had a bespoke rule.
Found while verifying P3-05: the RJSF form itself is correct on @rjsf/core —
9 inputs, 3 required markers, descriptions, prefilled defaults, password reveal,
and Test Connection / Submit / Close all render. It was only unreachable.
161 tests, build and lint green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This is the systemic cause behind most of the layout defects found against the live deployment, rather than another one-off. The app has ~200 hand-written CSS rules that target antd's internal class names — `.ant-card-body`, `.ant-modal-content`, `.ant-tabs-nav`, `.ant-table-body`, `.ant-btn`, `.ant-typography` and ~65 more. antd emitted those elements; my shims did not, so every one of those rules silently matched nothing. 109 of them set layout properties (height, overflow, display, flex, padding), which is exactly why screens looked structurally right in the DOM and wrong on screen. Measured before and after: **109 dead layout rules across 53 classes → 8 across 8**. The 8 that remain are leaf styling on features this app does not currently render (card meta, textarea counters, tab overflow controls). The shims now emit the class names alongside their Tailwind classes. This is deliberate coupling to the legacy CSS, not an accident, and it is temporary: when that CSS is eventually rewritten against the design tokens, the hooks come out. The P1-05 layout shim already did this for `.ant-space-item`/`.ant-row`; this extends the same approach to the rest. Also fixed while here: Divider, Radio.Group/Radio, Segmented items, Popover inner, Result subtitle, Dropdown menu items and Collapse header/content were missing their hooks. Found by static audit rather than by opening screens — the previous five bugs were each discovered one page at a time, which does not scale and would have missed the ones on screens nobody happened to visit. 161 tests, build and lint green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…udio Most severe defect so far: opening any Prompt Studio project showed "Couldn't load this page" and rendered nothing. Cause: PromptCardItems.jsx and NotesCard.jsx render `<Collapse.Panel>`, and SetOrg.jsx renders `<Card.Meta>`. Neither sub-component existed on the shims, so React received `undefined` as an element type and threw error #130. That does not degrade one component — it takes down the entire route. Collapse now supports both antd forms: the `items` data prop and the legacy `<Collapse><Collapse.Panel header=…>` children, including `showArrow={false}` which PromptCardItems relies on. Card.Meta renders avatar/title/description. Added a completeness guard (shim-completeness.test.jsx) instead of only fixing the two. It scans the app source for every `<Foo.Bar>` usage and asserts the shims actually expose it. The per-component tests could not have caught this: nothing in them rendered Collapse.Panel, so its absence was invisible until a real page tried. The guard covers 14 sub-components today and fails loudly for any future gap. It earned its place immediately — it caught that my first Collapse.Panel assignment had not landed (biome had reordered the export block my patch anchored to, so the edit silently no-opped). 176 tests across 16 files, build and lint at the 24-warning baseline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Found by static audit rather than by clicking: scanning for `Foo.bar(...)`
calls on shim components turned up two undefined statics.
ConfirmModal calls `Modal.useModal()` and then `modal.confirm({...})`. Neither
existed, so every consumer threw a TypeError the moment its button was clicked.
That is 12 components — delete actions across prompt studio, workflows, manage
docs, LLM profiles, custom synonyms and the top nav.
useModal now returns `[api, contextHolder]` and implements confirm/info/
success/error/warning/destroyAll on AlertDialog, so it shares behaviour with
useConfirm() instead of becoming a second confirm pattern. Escape and
outside-click resolve as Cancel.
Modal.confirm is implemented too — the fully-imperative form callable outside
React, which mounts its own root. No OSS call-site uses it today, but the cloud
plugins have three.
Extended the completeness guard to cover static calls, not just `<Foo.Bar>`
JSX. It now strips comments before scanning: a doc comment mentioning
`Modal.confirm` is not a call-site, and flagging it would teach people to
ignore the test.
180 tests across 16 files, build and lint at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Eleventh defect. The workflows "Create Prompt Studio" dialog rendered at
y=-127 with its header clipped off-screen, even after the earlier centring fix.
That earlier fix was correct — the classes were right this time. The override
came from the app's own stylesheet:
.prompt-studio-modal { padding: 10px; top: 20px; }
antd's modal wrapper is statically positioned, so `top: 20px` read as "20px
from the top of the viewport" and worked. The shadcn Dialog is
`position: fixed` and centres itself with `top: 50%` + `translateY(-50%)`, so
the same rule overrode the centring while the transform still applied — pulling
the dialog 127px above the viewport.
Removed the rule and left a comment explaining why, since it looks arbitrary
otherwise. Centring is the component's job now.
Added css-collisions.test.js rather than only fixing the one rule: it scans
every stylesheet for a modal/dialog ROOT selector setting top/bottom/transform
and fails with the offending file and rule. It deliberately ignores inner
elements (`__body`, descendant selectors, `.ant-*`), which cannot fight the
root's positioning. The remaining `.retrieval-strategy-modal__*` rules are
inner elements and are correctly not flagged.
This is the third distinct failure mode that jsdom cannot see (height 0, dead
CSS hooks, and now positional overrides), so it is worth having a static guard
rather than relying on someone opening the right screen.
182 tests across 17 files, build and lint at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Twelfth defect, and the most silent one yet: Prompt Studio's Export button did nothing. No menu, no error, no network request — I instrumented fetch and XHR to confirm zero calls were made. Export is the child of a `<Dropdown>`, and Radix renders its trigger with `asChild`, attaching handlers through a ref. Neither CustomButton nor the base shadcn Button forwarded refs, so the ref went nowhere and the trigger was never wired up. A dropped ref throws nothing and logs nothing, which is why this survived 182 passing tests and a full route sweep — the page rendered fine, the button just wasn't connected to anything. Both now forward refs. That covers the 24 Dropdown call-sites, plus Popover and Tooltip triggers that use the same asChild mechanism. Audited the other primitives: Badge, Kbd, Label, Skeleton and Spinner are also plain functions, but none is used with asChild anywhere, so they are not causing breakage. Left alone rather than changed speculatively. Four regression tests: the base Button and CustomButton each forward to a real DOM node, a Dropdown wrapping CustomButton gets aria-haspopup/data-state (proving Radix wired the trigger), and the menu actually opens on click. 186 tests across 18 files, build and lint at the 24-warning baseline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Found by the shim-completeness guard once the enterprise plugins were overlaid: ReviewHeader.jsx:910 renders <Dropdown.Button>Download File</...>, and Dropdown.Button was undefined. That is React error #130, which takes down the whole manual-review route rather than just the button — the same failure mode as the Collapse.Panel bug. Dropdown.Button is NOT Dropdown. In <Dropdown> the child IS the trigger, so naively aliasing the two would make "Download File" open a menu instead of downloading. antd's split button keeps the halves separate: children is a real action button wired to onClick, and only the chevron opens the menu. The three new tests pin exactly that separation, since it is the one thing an alias would silently get wrong. The chevron half carries aria-label="More actions" so both halves stay distinguishable by accessible name.
The shim accepted `presets`, `disabledDate`, `allowClear`, `onOk` and
`format` and did nothing with them. Nothing crashed, so this survived the
migration invisibly — but three of the five are behaviour, not decoration:
- `presets` MetricsDashboard's "Last 7/30/90 Days" buttons never
rendered. Those are the primary way the range gets set,
so the control looked finished while its main affordance
was missing.
- `disabledDate` MetricsDashboard uses it to block future dates. Ignored,
users could query tomorrow. Now probed outward from today
and mapped onto the inputs' min/max, which is the bound a
native input can actually enforce.
- `allowClear` antd defaults to true; MetricsDashboard passes false
because its handler drops anything that is not a complete
pair. Emitting null there strands it on a stale range.
`onOk` now fires when a range becomes complete (there is no popup confirm
button to hang it off). `format` and `size` are destructured to keep them
off the DOM.
Also stops forcing moment on the way out. ExecutionLogs holds moment,
MetricsDashboard holds dayjs; the shim rebuilt every emitted date as moment,
handing MetricsDashboard a type it never opted into. It happens not to break
because that code only calls .toISOString(), which both implement — but it
quietly reverses D7's promise that this layer does not change what flows
through it. Emitted dates are now cloned from the caller's own instance.
Each of the five behaviours has a test, and each was mutation-checked: the
prop was re-broken one at a time and the matching test failed every time, so
these assert the fix rather than restating it.
… broken Live check on the dashboard caught this: the preset buttons rendered, but `disabledDate` produced no `max` bound, so future dates were still pickable — the very thing the previous commit claimed to fix. Cause: `new sample.constructor(isoish)` looks like a reasonable way to rebuild a date in the caller's library. It is wrong for both libraries in use. dayjs's internal constructor takes a config OBJECT, so handed a string it ignores it and returns TODAY. moment's returns an object that throws on .format(). So the disabledDate probe compared today against today on every iteration, never crossed the boundary, and yielded no bound. Now clones the caller's instance and re-points it field by field, which both libraries support (dayjs setters return a new instance, moment's mutate and return this; assigning the result covers both). The result is asserted to land on the exact requested instant before it is returned. The reason this got through: the test used a hand-written dayjs-shaped stub whose constructor DID accept a date string, so it validated the stub rather than the shim. Replaced with the real dayjs and moment, plus a case pinning the actual predicate MetricsDashboard passes. Re-broken deliberately to confirm the new test fails against the old approach.
Caught by driving the deployed dashboard: its range read 28 Jul → 28 Jul when the default is "last 30 days", and clicking a preset appeared to do nothing because the fields already showed today either way. `moment(dayjsInstance)` is the culprit. It does not throw and does not report invalid — it silently returns a moment for TODAY. `toInputValue` called it for anything that was not already a moment, so every dayjs value rendered as today with nothing to indicate it. MetricsDashboard holds dayjs, so its whole range was wrong on screen while its state was correct. Values exposing valueOf() (dayjs, moment, Date) are now normalised through the epoch instant before parsing. Strings are unaffected: String.valueOf() returns the string, so ISO parsing is unchanged. This one predates the previous two commits — the presets and disabledDate work was correct, but sat on top of a display path that had been broken for every dayjs caller since the shim was written. Verified across dayjs, moment, ISO string, Date, unparseable and null; the two new tests fail when the old moment(value) call is put back.
Two native date inputs were parity with nothing — antd's RangePicker has
always been a two-month calendar with a preset sidebar, so the inputs were a
downgrade users would notice. New component for us, not new capability.
Adds a shadcn Calendar over react-day-picker v10 (which ships no stylesheet,
so every colour is a Midnight Bloom token and it tracks light/dark), and
rebuilds RangePicker as a single `ant-picker-range` trigger opening a
popover: preset sidebar on the left, two months on the right.
The external contract is unchanged and still mutation-tested: moment/dayjs
tuples in and out, presets, allowClear, onOk, disabledDate. Two things the
calendar does BETTER than the inputs it replaces:
- `disabledDate` is per-date in antd, and a calendar greys out individual
days. The native inputs could only approximate it by probing outward for
a min/max bound.
- the whole range is one control, so there is no half-updated state
between two separate fields.
Two library behaviours worth recording, both found by probing rather than
assuming:
- react-day-picker reports {from, to} with BOTH set to the clicked day on
EVERY click; it does not distinguish opening a range from closing one.
Taken at face value, onOk fires on click one and click two restarts
instead of completing. An explicit anchor restores antd's semantics and
orders the ends so a backwards selection still yields start <= end.
- two months plus outside-day overflow means one date can appear twice in
the DOM, so the test helper takes the non-outside cell.
All six behaviours were re-verified by mutation. The first pass missed one:
swapping likeSample for moment inside the disabledDate path went undetected,
because the library-preservation tests only covered onChange. Added a test
asserting the type the predicate itself receives.
bun.lock is updated (not package-lock.json, which is gitignored here) —
`bun install --frozen-lockfile` is what the Docker build runs, and an
npm-only install would have failed it the way a missing bun.lock did before.
The unit tests each drive one prop in isolation, which is how the earlier
dayjs display bug slipped through: every individual assertion passed while
the combination users actually see was broken.
This renders the exact props MetricsDashboard passes — dayjs values, its
disabledDate predicate, allowClear={false}, size, and all three presets —
then drives the whole interaction: open the trigger, confirm two months and
the preset sidebar, click a preset, and assert the emitted pair is dayjs and
spans exactly 7 days.
Cheap to run and it fails on any of the regressions this branch has already
hit once.
Live check on the deployed dashboard: the popover opened 250px wide and ~700px tall, bottom edge at 1070px in a ~780px window — the two months were stacked in a column instead of sitting side by side, and the bottom of the calendar was unreachable. Cause: `sm:flex-row` on the months and `sm:flex-col` on the preset sidebar. Tailwind's `sm:` measures the VIEWPORT, but this content lives inside a popover whose own width is what decides the layout. On a wide screen the breakpoint matched and still produced a stacked column, because the popover never gets the viewport's width. Both are now unconditional rows. Worth noting how close this came to shipping: the screenshot was clipped at the viewport edge, so the popover looked plausible until its geometry was measured. jsdom has no layout engine and could never have caught it. The added guard asserts the class contract rather than the geometry — it fails if a `sm:` variant reappears in the popover — and was confirmed by reintroducing the bug.
MetricsDashboard.jsx and RecentActivity.jsx both `import dayjs from "dayjs"`,
but dayjs was never in package.json. `npm ls dayjs` showed the only path:
frontend -> react-js-cron@5.2.0 -> antd@5.29.3 -> dayjs@1.11.19
That is a live hazard rather than a tidiness issue: antd itself is already
undeclared (the migration removed it) and survives only because react-js-cron
still depends on it. The moment react-js-cron is replaced — which the antd
removal work requires anyway — antd goes, dayjs goes with it, and two
production components stop resolving an import they have always relied on.
Pinned to the exact version already resolving (1.11.19, not a caret range) so
declaring it changes nothing at runtime today; it only removes the dependency
on a transitive path we intend to delete.
…ts return
antd was still in the tree. Every plan task about removing it passed —
P4-05 (no imports), P4-08 (not in the manifest), the P4 exit gate — because
they all check source imports and package.json. None of them look at the
RESOLVED tree, and antd was reachable transitively:
frontend -> react-js-cron@5.2.0 -> antd@5.29.3
58MB of framework serving one 38-line component with a single call-site.
Replaces react-js-cron with a hand-rolled picker on the existing primitives
rather than another library: a new dependency is a new transitive surface,
which is the thing being removed. It offers hourly/daily/weekly/monthly plus
a custom expression, and validates through cronstrue — the same parser the
call-site already uses for its summary, so anything the dialog accepts the
surrounding UI can render. Invalid expressions cannot leave the dialog.
The contract is unchanged: `setCronValue` still receives a 5-field string.
Checked before removing, since the OSS package.json is the only manifest
(plan §3.3) and dropping a dep drops it for the cloud plugins too:
- react-js-cron is antd's ONLY dependent (npm ls antd)
- no cloud plugin imports react-js-cron
- no app CSS targets its class surface
Result: `npm ls antd` empty, no node_modules/antd, no @ant-design, and no
antd runtime markers in any built chunk. Bundle 6.0MB -> 5.7MB, build 45s ->
27s.
Adds a fourth static guard beside the existing three. A one-time grep proves
today is clean and does nothing about the next dependency bump — and this
defect survived the entire migration precisely because nothing failed. It
checks all three ways antd can come back (declared, transitive, imported);
each was verified by reintroducing it and watching the matching case fail.
Also covers the nested-dialog case: CronGenerator renders as a sibling after
EtlTaskDeploy's own Modal, so production stacks two Radix dialogs. The
existing scroll-lock test covers one. These assert the inner opens over the
outer, stays interactive, and leaves body overflow hidden on unmount (P0-12).
…yment
Walked the app side by side with globe.unstract.com. Four real differences,
batched into one deploy.
1. Every uncoloured border drew BLACK (~200 elements per settings page).
Tailwind's border utilities set width only; the colour falls back to
currentColor. shadcn's setup ships a `border-color: var(--border)` default
and ours was missing it, so `border`, `border-b` and `divide-y` all drew
solid black where antd had a near-invisible hairline — most obviously as a
black rule between every list row. Fixed once in the theme rather than at
call-sites, so the next uncoloured border is right by default.
2. A grey block behind the icon button on every prompt card (7 on one Prompt
Studio screen). antd applies a Badge's `style` to the COUNT; the shim let
it fall through `{...props}` onto the wrapper span, so
PromptChangeIndicator's `style={{ backgroundColor: color }}` painted the
wrapper. Also implements `offset`, which was accepted and ignored.
3. Invite Users was a blank "Couldn't load this page". antd's NamePath allows
arrays — InviteEditUser uses `name={["email"]}` — but react-hook-form
calls `.split(".")` on the name, so it threw
`TypeError: s.split is not a function` and the error boundary swallowed
the whole route. Arrays are antd's dotted path, so joining reproduces it.
The cloud StripeProductForm uses nested `name={["tier1", "up_to"]}`, so
this was broken there too.
4. Form labels pointed at nothing. `<Label htmlFor={name}>` was rendered but
no id was ever set on the control, so clicking a label did not focus its
field and screen readers announced it unlabelled. Found while writing the
test for #3.
Each fix has a regression test, and each was mutation-checked by
reintroducing the defect and confirming the matching test fails.
Comparing dev against the reference surfaced link buttons still painted antd's #1677ff — the Create Prompt Studio dialog renders its actions in antd blue rather than Midnight Bloom purple. antd is gone, so nothing supplies those colours any more; they were simply hardcoded, and 42 `!important` declarations in PromptStudioModal.css meant they beat the token styling wherever they appeared. 26 declarations across 8 files, all now `var(--primary)`. Also converts the black-alpha text in that file — `rgba(0,0,0,.45)` and `rgba(0,0,0,.88)` — to `--muted-foreground` / `--foreground`. Those are invisible-on-invisible in dark mode, which the old antd theme never had to handle. Colour-only; no structural change, and the full suite is unaffected.
Two reported issues, both traced to the same kind of cause: markup or sizing
the shim quietly changed.
LOADER — the logo was neither horizontally centred nor aligned with its text.
`.center` (index.css) sizes itself with `width/height: inherit`, which does
not resolve to the viewport; it collapsed to the height of its own content
(measured: 24px), so the box landed wherever it fell rather than mid-screen.
LazyOutlet.css already carries a patch for `.center` for exactly this reason.
Scoped the fix to `.generic-loader` so the other consumer — FileSystem's
inline empty state — keeps sizing to its container, and made `.spinner-box` a
centred flex column so the logo, pulse dots and text share one axis.
Measured after: logo centre-x 768 in a 1536 viewport, and equal to the text's
centre-x.
SIDEBAR — bottom menu items were cut off and unreachable. Two causes:
1. The Sider shim rendered children bare. antd wraps them in
`.ant-layout-sider-children`, and SideNavBar.css depends on that
wrapper: it is the flex column which clamps `.sidebar-content-wrapper`
so its `overflow-y: auto` has something to scroll against. Without it
the wrapper grew to its full 929px content height inside a 668px rail,
so `auto` never engaged.
2. `.side-bar.ant-layout-sider-collapsed .sidebar-content-wrapper` set
`overflow-y: hidden` under a comment saying "hide scrollbar". The
scrollbar was already hidden by `scrollbar-width: none`; that rule was
disabling SCROLLING, so the collapsed rail — which is how the sidebar
actually renders — could not reach its lower entries on any window
shorter than ~1000px.
Verified live: both states now scroll, scrollbar still hidden. The reference
deployment does not overflow only because its window is taller (766px vs
721px); it has the same content height, so this was latent there too.
The Sider wrapper has a regression test, mutation-checked by removing the
wrapper and confirming it fails.
The migration left two competing definitions of "primary". The Button
shim maps antd `type="primary"` to the shadcn `default` variant
(`--primary`, violet), but CustomButton.css then repainted it navy
`#092c4c` — so the 24 CustomButton call-sites rendered a different
colour from every plain `<Button type="primary">`.
Rather than retokenise that override, it is deleted along with the
stylesheet: the shim already produces the right colour, and a second
definition would only drift again.
Sidebar: `.side-bar` hardcoded `#0d3a63` while `.topNav` (PageLayout.css)
uses `var(--primary)`, so the two bars meeting at the top-left corner
were different colours. Now both are `var(--primary)`.
Deliberately NOT `var(--sidebar)` — that token is white in light mode,
and every rule in SideNavBar.css assumes a dark surface. The navy-derived
values that no longer work on violet are rebased with it:
- `.space-styles` hover/active `#005b82` → a white overlay, which
tints whatever `--primary` is in either mode.
- `.sidebar-item-text` / `.sidebar-antd-icon` `#b4c2cf` measured
6.41:1 on navy but only 2.6:1 on violet — under even the 3:1
large-text floor. White is 4.72:1 and clears AA; the intermediate
tints (#e8e5fb, #dcd8f9) top out at 3.82:1 and do not.
Also implements antd's `showCount`, which the Input/TextArea shim
dropped into `...props`: three modals asked for a counter and rendered
none while `maxLength` still silently truncated typing.
Remaining navy in CardGridView/ListView/SetOrg is text, not a surface,
so it maps to `--foreground` (or `--primary` for the icon hover accent).
Tests 225 → 229; lint holds at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Follow-up to the primary-colour unification. That change only swept the
navy family, so antd's stock palette survived — including #1890ff on the
sidebar that had just become violet.
Sidebar icons were the visible regression. They are inline SVG assets
with `fill="#90A4B7"` baked in, a slate grey chosen for navy where it
measured 4.54:1. On `--primary` violet it falls to 1.84:1 and the icons
all but disappear. The assets are data-URI <img> sources, so `color`
cannot reach them; instead the `brightness(0) invert(1)` filter that the
hover rule already used is applied at rest and dimmed to opacity 0.85 to
match `.sidebar-item-text`, with the active state going to full white so
the inactive/active distinction the hover rule drew is preserved.
The rest is a role-based conversion, not a find-and-replace:
- #1890ff / #1677ff as an accent, link or active state -> `--primary`
- the same in `outline:` (focus rings) -> `--ring`
- #40a9ff (antd's hover blue) -> `--violet-300`
- #52c41a -> `--success`, #faad14 -> `--warning`
- `.sidebar-toggle-icon.pinned` -> white; it only needs to read as "on"
against the unpinned 60% white, not introduce a third brand colour
Chart and per-type icon palettes (MetricsChart, RecentActivity, the
Agency progress stroke) are deliberately multi-colour scales and keep
their literals — tokenising them would collapse distinct series into one
colour.
Tests hold at 229; lint at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…and modal width Five defects, several sharing one root cause. 1. Input borders looked uncoloured on the left and right. The default-border-colour rule added earlier sat OUTSIDE any cascade layer. Unlayered CSS beats layered CSS regardless of specificity, so it outranked Tailwind's `utilities` layer and repainted every explicitly coloured border. `border-input` was the casualty: form controls resolved to `--border` (#e5e5e5) instead of `--input` (#d3d3d3), leaving inputs a full shade lighter than the antd reference — 1.21 vs 1.41 contrast against the page. The thin left/right edges wash out first at fractional device-pixel widths, which is why only they looked absent. Moving the rule into `@layer base` keeps it as the fallback for uncoloured borders while letting `border-*` utilities win, which is what shadcn intends. The 0.8px border width is NOT a bug: at dpr 1.25 Chrome snaps 1px to one device pixel and reports it back as 0.8px. The antd reference computes 0.8px too. 2. Buttons showed no hand cursor. Tailwind v4 dropped v3's preflight `cursor: pointer` on `<button>`, and antd had set it on every control. Added to the Button variants and to the other primitives that read as clickable: Select trigger and items, dropdown items, checkbox, radio, tab triggers. `disabled:pointer-events-none` still wins for disabled. 3. The emoji picker could not be dismissed with Esc or an outside click. antd call-sites pass `open` and drive it from the trigger themselves; Radix reads a bare `open` as fully controlled, so it had nowhere to report a close. The Popover shim now always supplies `onOpenChange`, and consumes antd-only props (`trigger`, `arrow`, `overlayClassName`) that were landing on the DOM. 4. The same picker was cut off: shadcn's PopoverContent is a fixed `w-72` (288px) with `p-4`, and the picker is wider and brings its own chrome. Now `w-auto` with a viewport-aware max and collision padding. 5. Import Project: the modal rendered at 570px instead of the requested 600 and drifted off-centre, because `width` was applied as `maxWidth` only and shadcn's `w-full max-w-lg` stayed in charge. And `Upload.Dragger` was aliased to `Upload` — an inline span, so the drop zone had no border, no fill, and no drag handlers at all. Dropping a file navigated the browser away to render it. Both fixed; Upload now handles drops. Tests 229 -> 232, mutation-verified; lint at the 24-warning baseline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both defects shipped, and neither is visible to jsdom — there is no cascade-layer resolution and no cursor — so they are asserted the way `no-antd.test.js` asserts its invariant: against the source text and the emitted class list. The border one had been reported twice. Unlayered CSS outranks every layered rule regardless of specificity, so the universal border-color selector silently beat Tailwind's `utilities` layer and repainted `border-input`; both mutations (unwrapping @layer base, dropping cursor-pointer) fail these tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Import Project drop zone rendered with a solid edge despite carrying
`border-dashed`. The cause was a legacy app utility in index.css:
.border { border-style: solid; }
Its name collides with Tailwind's `border` utility. Tailwind v4 emits
`.border{border-style:var(--tw-border-style)}` so that `border-dashed`
can swap the style through that variable — but the app rule is declared
later and hard-codes `solid`, so it won and the variable never applied.
Removed rather than renamed: every remaining `className="… border …"` in
the app is Tailwind's utility, which already defaults to solid, so
nothing depended on this rule for its own sake.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Save appeared to do nothing on the Prompt Studio project modal. The cause
was four antd Form APIs the shim never implemented, and the failure is
shared by 8 screens, not one:
onValuesChange dropped, so handlers that mirror the form into component
state never ran. AddCustomToolFormModal submits
`formDetails`, which therefore stayed at its initial empty
value — Save posted an empty body and the backend rejected
it silently.
setFields missing entirely. Those same handlers call it on every
keystroke to clear the edited field's error, so wiring
onValuesChange alone would have turned silent staleness
into a TypeError on 6 screens (New Workflow, API Deployment
x2, ETL Task, Notifications, LLM Profile). Both land here
together for that reason.
initialValues never applied, so edit modals opened blank.
validateStatus fell into ...props and landed on the wrapper div, so the
+ help backend's 400 message was never shown and React warned
about unknown DOM attributes.
No client-side validation was added to Save: antd did not do it either.
`onOk` calls the handler directly and the rules were decorative — real
validation is backend-driven and surfaced through validateStatus/help.
Adding validateFields() would change submit behaviour on 8 screens.
`initialValues` applies on MOUNT ONLY, matching antd. The call-sites pass
`initialValues={formDetails}` *and* write `formDetails` from
`onValuesChange`; re-seeding on change would reset the form to the value it
just reported and clobber typing.
Also: cursor-pointer on the hand-rolled clickables that bypass the Button
component and so never got the earlier fix — the Segmented toggle
(Projects | Look-Ups), Menu items, FloatButton, Tag close, Drawer close,
password reveal, Tree/Dropdown rows, RangePicker trigger and presets,
Calendar day cells, and the Upload role="button" span.
Popover gets `max-h-[--radix-popover-content-available-height]` +
overflow-y-auto so tall popovers stop overflowing the viewport (the emoji
picker was cut off at the bottom), and the picker is given an explicit
height since it sizes its own scroller.
Tests 239 -> 245, mutation-verified; lint at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Requested as an experiment ("let's try that"), so it is a standalone commit
and reverts cleanly with `git revert`.
Two levers, because one alone would not have been uniform:
--text-sm 0.875rem -> 0.8125rem. `text-sm` is the app's dominant size —
nearly every label, table cell, menu item and control renders
through it — so this is what actually moves perceived text size.
Its paired line-height is restated too; Tailwind derives that
from the stock 0.875rem, so 13px text would otherwise keep 14px
leading.
53 hardcoded `font-size: 14px` declarations across 17 stylesheets, which
a token change cannot reach. Left alone they would have made the result a
patchwork of 13px and 14px text.
Deliberately NOT `html { font-size: 13px }`: Tailwind v4 spacing, gaps and
control heights are rem-based, so changing the root shrinks the entire UI —
padding, button heights, icon boxes — rather than just the type.
Sizes other than 14px are untouched: headings (16px+), the 12px/11px
secondary text, and the sidebar's 15px section headings keep their scale.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both reported with screenshots after two failed attempts from me. The
screenshots are what identified the real causes — in each case my earlier
fix addressed the wrong thing.
Input "left and right borders missing":
The borders were always drawn. `shadow-sm` is `0 1px 3px` + `0 1px 2px` —
a purely VERTICAL offset — so it lays a dark smudge under the top and
bottom edges and contributes nothing to the sides. The horizontals read as
a firm line, the verticals as a bare 1px hairline at ~1.2 contrast, and
the eye reads the difference as "the sides are missing". The give-away is
in the screenshot: the FOCUSED textarea, which has a ring, shows all four
sides evenly.
The antd reference computes `box-shadow: none` on its inputs, so removing
it both fixes the asymmetry and matches the reference. Removed from
Textarea and the Select trigger too, or those would keep the asymmetry
while sitting beside a fixed Input in the same form.
Earlier attempts at this were wrong: the colour (--input vs --border) was
a real bug but not this one, and the sub-pixel/dpr analysis was a red
herring — the effect is symmetric across dpr, the shadow is not.
Emoji picker cut off:
Clipped on the RIGHT, not the bottom, so the earlier height cap missed it.
Two causes: `max-w-[min(92vw,26rem)]` (416px) in the Popover shim was
itself the clipping box for a picker that needs ~440px, and
`placement="rightTop"` threw it past the modal's right edge. Now sized to
`--radix-popover-content-available-width` and opened downward.
Padding is no longer forced by the shim — the sidebar and ConfigureDs
popovers want shadcn's `p-4`, while a self-chromed widget like the picker
wants none, so it is left to `overlayClassName`. `.emoji-modal` gets a
doubled selector because a single class only TIES with Tailwind's `p-4`.
Two bugs found while verifying:
- The trigger had its own `onClick` toggling `showEmojiPicker` as well as
the shim's `onOpenChange`, so each click fired two state updates that
raced and could leave the picker unable to reopen. Radix owns it now.
- The shim's placement->align mapping only tested Top/Bottom, so the
Left/Right suffixes (`bottomLeft`) silently fell through to `center`.
Tests 245 -> 247, with a guard so the shadow cannot come back.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The shim layer is scaffolding, not architecture: it exists so ~360 call-site
files could cross the antd boundary by changing an import, and it is meant to
be deleted as call-sites migrate to the shadcn primitives directly. Sitting
alongside those primitives in `ui/`, nothing said so — `antd-button.jsx` and
`button.jsx` read as peers.
`ui/shims/antd-*` makes the distinction structural. What stays in `ui/` is
permanent (the shadcn primitives); what is under `shims/` is on its way out.
Pure move plus import rewrite — no behaviour change. 195 OSS files updated,
and 187 cloud plugin files in unstract-cloud, which import these paths too
and are bundled into the same build; OSS alone would have passed its tests
and build while breaking every enterprise screen.
`shim-completeness.test.jsx` moves with the shims and needed two path fixes,
both of which fail silently rather than loudly:
- its scan root is relative to its own location, so "../.." became
"../../.."; left stale it scans src/components/ instead of src/ and
quietly stops covering most of the app
- it skips the shims by matching the path fragment `/ui/antd-`, now
`/shims/antd-`
The stale root passed all 17 assertions, so the root is now asserted
explicitly and fails with an explanatory message.
Tests hold at 247; lint at the 24-warning baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The repo imported Radix two ways: 19 files used the per-component `@radix-ui/react-*` packages (shadcn's published convention) while button.jsx and label.jsx used the consolidated `radix-ui` package, which newer shadcn output emits. The duplication is real but harmless — `radix-ui@1.6.7` depends on `@radix-ui/react-dialog@1.1.23`, exactly the version installed directly, so both entry points resolved to the same code. Verified before changing anything that `radix-ui` re-exports all 19 primitives in use, none missing. Now one convention and one version to bump. No bundle-size change is expected: it is the same code either way. The 19 direct dependencies are dropped from package.json. Both lockfiles are tracked, but the local bun (1.1.26) only writes the binary bun.lockb and leaves the text bun.lock's root dependency block stale — and the Dockerfile copies bun.lock alone and runs `--frozen-lockfile`. The text lock's root block is therefore synced explicitly, and verified by running `bun install --frozen-lockfile --ignore-scripts` against a copy of just package.json + bun.lock, as Docker does. Note this moves AWAY from Flow's convention, which uses the per-component packages. Internal consistency was preferred over cross-product symmetry; worth revisiting if shared components are ever extracted. Tests hold at 247. Lint is unchanged at 3 errors / 26 warnings — all pre-existing oversized-SVG-asset diagnostics, confirmed identical against a clean extract of HEAD. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Done in two phases so the two failure sources stayed separable. Phase 1 — testing libraries, still on React 18: @testing-library/react 13.4.0 -> 16.3.2 (+ @testing-library/dom peer) @testing-library/user-event 13.5.0 -> 14.6.1 @testing-library/jest-dom 5.16.5 -> 6.10.0 user-event v14 replaces the synchronous `userEvent.type(el, …)` API with a `setup()` instance whose actions are awaited. That was projected to be the bulk of the work; it turned out to be 12 call sites across 2 files, which are now `const user = userEvent.setup(); await user.type(…)`. The converted tests were mutation-checked (breaking Input's onChange forwarding still fails 3 of them) to confirm the async rewrite did not turn assertions into no-ops. Phase 2 — react + react-dom 18.2 -> 19.2, @types/react(-dom) -> 19. All 248 tests passed with no source changes, and the old `ReactDOMTestUtils.act` deprecation warning is gone. One real breakage, which tests did NOT catch: React 19 ignores `defaultProps` on FUNCTION components, so each default silently becomes undefined — the same silent-prop-drop class as the Save-does-nothing bug. Seven components are converted to default parameters. ErrorBoundary keeps its block: it is a class component, where defaultProps is still supported. A guard test now fails, naming the file, if defaultProps reappears on a function component. Verified: no React 19 deprecation warnings, no string refs (the `ref="` matches were `href=`), production build clean. Tests 247 -> 248. Lint unchanged at 3 errors / 26 warnings, all pre-existing oversized-SVG diagnostics. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
|



Implements P1-01 … P1-04 of
UN_SHADCN_IMPL_PLAN.md.Contains the P0 foundation commit too (
a0473a1) — see #2211 for that in isolation. Review commit-by-commit:a0473a126a8c64612875ba0f3848The main decision to review: shims instead of find-and-replace
The plan specified mapping antd props to Tailwind classes inline. That is unsafe for Typography and Button, because both carry behavior, not just styling — and silently dropping behavior is a C4 violation, not a restyle:
Typography ellipsis—ellipsis={{ tooltip: true }}truncates and surfaces full text on hover;{{ rows: 2 }}clamps lines. 12 call-sites use the object form. Tailwind'struncateis CSS-only, so a class swap would delete the tooltip.Button loading(234 usages) — swaps in a spinner and disables the button. Dropping the disable would permit double-submits on in-flight requests.Button danger— orthogonal totype, so not a 1:1 variant map (danger+text must stay ghost-with-destructive-text).So each got a small shim presenting antd's API on shadcn primitives + Midnight Bloom tokens. The 295 Typography and 70 Button call-sites then become import swaps with JSX untouched — same elements, same order, same props, which is exactly what C4 asks for. Per D9/§5.0 both live in OSS so cloud plugins import them in Phase C.
CustomButton(76 usages) is a pass-through over antd's Button, so it routes through the shim automatically.Two subtle bugs caught
FileUpload.jsx/FileWidget.jsximport antd'sUploadcomponent, shadowed by the lucideUploadicon — would have broken both upload widgets.Workflows.jsxdefines its ownUsercomponent; importing lucide'sUsermade it render itself (infinite recursion).useRetrievalStrategies.jsemits icon name strings consumed by a modal'sICON_MAP; the modal's keys became lucide names while the hook still emitted antd names, so every lookup would have silently fallen back to a default icon.Verification
main--radius-mdtoken.Plan estimates are running low — worth correcting
The original enumeration used single-line regexes that missed multi-line import blocks. I re-measured all remaining components; accurate per-component counts are in the commit history.
🤖 Generated with Claude Code