Skip to content

[P0-P4] Remove Ant Design from the OSS frontend (shadcn/ui + Midnight Bloom) - #2212

Merged
jaseemjaskp merged 186 commits into
mainfrom
feat/shadcn-oss-migration
Sep 1, 2026
Merged

jaseemjaskp merged 186 commits into
mainfrom
feat/shadcn-oss-migration

Conversation

@hari-kuriakose

Copy link
Copy Markdown
Contributor

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:

Commit Scope
a0473a1 P0 foundation — deps, Midnight Bloom tokens, 32 primitives, theme provider
26a8c64 P1-01/02 icons → lucide (91 files, 87 icons)
612875b P1-03 Typography shim (93 files)
a0f3848 P1-04 Button shim (70 files)

The 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's truncate is 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 to type, 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.jsx import antd's Upload component, shadowed by the lucide Upload icon — would have broken both upload widgets.
  • Workflows.jsx defines its own User component; importing lucide's User made it render itself (infinite recursion).
  • useRetrievalStrategies.js emits icon name strings consumed by a modal's ICON_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

  • Build passes; 39 tests across 6 files green (23 of them new, covering the shim behaviors above)
  • Lint: 0 errors, same 24 pre-existing warnings as main
  • Browser: no console errors; antd elements on the landing page fall 33 → 24; the Login button keeps exact geometry (50px, same color/position). Radius 6px→8px is the intended --radius-md token.

Plan estimates are running low — worth correcting

Item Plan Actual
Icons 162 files / 43 icons 91 files / 87 icons
Typography 158 sites 295 sites
Button 130 sites 70 files

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

hari-kuriakose and others added 4 commits July 27, 2026 01:35
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>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5fef313-4024-4b96-8935-a1ae97f9b482

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shadcn-oss-migration

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>
@hari-kuriakose

Copy link
Copy Markdown
Contributor Author

⚠️ Correction: primary buttons change colour site-wide (navy → violet)

My P1-04 commit message said geometry was preserved and implied no colour change. That was measured on the unauthenticated landing page only, where the Login control isn't an antd Button — so it understated the blast radius.

App.jsx had a ConfigProvider override painting every antd Button colorPrimary: "#092C4C" (the old Unstract navy). With no antd Buttons left after P1-04, that override styles nothing and has been deleted. Primary buttons now take --primary from Midnight Bloom, so every type="primary" button in the authenticated app moves #092C4C navy → #6f5cef violet.

This is the intended end state under D8 (Midnight Bloom is the approved palette) — flagging it because it's a site-wide visual change that deserves to be an explicit decision rather than a side effect noticed in review. If primary buttons should stay navy, that's a token change in index.css, not a code change.

Same mechanism explains the notification "Close" links going blue → violet in the screenshot.

Also in 5146c8d

  • docs/shim-convention.md — the rule for the remaining ~15 components: shim when antd implements behaviour shadcn doesn't, direct swap when the difference is only styling. Includes the per-component decision with usage counts, and the naming convention (antd-<component>.jsx marks migration debt with an exit).
  • Renamed typography.jsx → antd-typography.jsx (94 import lines) so both shims follow one convention.
  • One trap recorded for P1-05: Space wraps each child in its own <div>. Replacing it with gap-* on the parent removes those wrappers, so any CSS selector matching > * stops applying. Needs a grep of .map()/conditional children before scripting.

hari-kuriakose and others added 6 commits July 27, 2026 03:28
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>
@hari-kuriakose hari-kuriakose changed the title [P1] antd → shadcn: icons, Typography, Button [P0-P4] Remove Ant Design from the OSS frontend (shadcn/ui + Midnight Bloom) Jul 27, 2026
@hari-kuriakose

Copy link
Copy Markdown
Contributor Author

Migration complete — P0 through P4, plus the cloud plugins

Result: grep -rl "from 'antd'" src/ returns nothing, and antd, @ant-design/icons, @rjsf/antd and @react-awesome-query-builder/antd are all out of package.json.

Cloud side: Zipstack/unstract-cloud#1683 (190 files, all 53 plugins). This PR must land first — the plugins import the shims defined here.

Phase Scope
P0 Foundation — Tailwind v4, Midnight Bloom tokens, 32 primitives, theme provider
P1 Icons (91 files / 87 icons), Typography, Button, layout, leaves
P2 Modal, Tooltip, Dropdown, Popconfirm, Popover, Collapse, useConfirm(), sonner
P3 Form + inputs, date/time, RJSF
P4 DataTable (TanStack), remaining structure, antd removal

The judgment call that shaped this

The 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:

  • Form.validateFields() rejects on invalid. Call-sites are written await form.validateFields().catch(() => null) and bail on null. Had it resolved instead, every guard would silently pass and submit bad data.
  • Button loading (234 usages) shows a spinner and disables — dropping the disable permits double-submits.
  • ellipsis={{ tooltip }} truncates and reveals full text on hover; truncate is CSS-only.
  • Space wraps each child in .ant-space-item, and 20 hand-written CSS rules select those wrappers.

So each got a shim presenting antd's API on shadcn primitives, and ~700 call-sites converted by import swap with JSX untouched. docs/shim-convention.md records the rule; docs/form-pattern.md documents the highest-risk one.

Two P3 items came in far under estimate

  • RJSF (D3): RjsfFormLayout already supplies its own widgets and templates, so @rjsf/antd contributed only theme chrome. Swapping to @rjsf/core was a one-line change — there was no widget registry to rebuild.
  • Date/time (D7): the pickers are rebuilt on native inputs but still exchange moment objects, because call-sites do onChange={(d) => onChange(d?.toISOString())}. Dropping moment changes timezone/DST behavior, which D7 says needs its own reviewed pass. moment remains a dependency deliberately.

Known follow-ups (not blockers)

  1. Primary buttons moved navy → violet site-wide (disclosed earlier in this PR). Intended under D8; reversible via one token.
  2. ant-row/ant-col/ant-space-item class names still appear in the DOM. Those are emitted deliberately by the layout shim because 20 CSS rules select them. They go when that CSS is cleaned up — the plan's P4-09 CSS prune is the remaining piece.
  3. Query-builder vanilla styling — functional, but needs Tailwind polish to match.
  4. The antd-* shims are migration debt with a documented exit story, not permanent API.

Verification

Build 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 main baseline — the 3 errors are two SVG assets byte-identical to main, and zero findings are in files this migration added.

hari-kuriakose and others added 15 commits July 27, 2026 13:33
…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.
jaseemjaskp and others added 20 commits August 31, 2026 12:36
An icon rendered as a bare `<span>` or `<svg>` puts NOTHING in the
accessibility tree. Radix merges a Popconfirm's or Dropdown's trigger props
onto whatever child it is handed, so these all worked under a mouse and were
unreachable by keyboard and unnameable by a screen reader:

- Share access -- revoke a user's or group's access
- Export settings -- remove a user from a custom share
- Manage Groups -- the row kebab, i.e. Manage members / Edit / Delete
- Group members -- remove a member

Each becomes a `<Button type="text">` from the antd-button shim with an
`aria-label` naming its subject ("Revoke access for trt"), which is the idiom
CoOwnerManagement and the card kebab menus already use. The shim spreads the
label onto a real <button> and shadcn's variants size the icon, so no
component CSS is needed for any of them.

The Groups kebab also carried `rotate={90}`, an antd icon-font prop that does
nothing on a lucide SVG beyond emitting an invalid attribute -- it had been
rendering horizontal. `EllipsisVertical` is the glyph it was asking for.

Checked in a browser rather than from the diff, because the failure is
invisible in the DOM: driving each control by its accessibility-tree node is
the proof, and none of them had one before.
antd's Menu fires both `onClick` and `onSelect` when a selectable item is
picked, and a call site may listen on either. The shim only forwarded
`onClick`, so `onSelect` fell through into the rest props and landed on the
<nav> as React's DOM `select` handler — which never fires on a click.

The Output Analyzer's Document List wires its handler to `onSelect` alone,
so picking another document silently did nothing: no error, no warning,
just a dead menu.
The row was recorded by an onClick on the kebab icon — the Dropdown's
trigger. Radix opens the menu on pointerdown and pins `pointer-events:
none` on <body> while it is open, so the click that would have followed
never lands and that handler never runs. Edit therefore navigated to
/users/edit with no location.state, which InviteEditUser bounces to the
dashboard; Delete's confirmation named no user at all.

Build the menu entries per row instead, so each one closes over its own
record and nothing depends on the trigger's click.
The Card shim never declared antd's `hoverable`, so `...props` put it on
the `<div>` as an unknown attribute and the pointer cursor and hover lift
were simply lost. Ten call sites pass it -- the adapter cards in Add LLM
among them, which read as inert.

Consume the prop and style it with Tailwind rather than emitting
`ant-card-hoverable`: nothing in the app's CSS targets that class, and
picking up antd's own rule would depend on whether an antd Card happened
to render.
The LLM, Vector DB and Embedding settings pages list adapters, not
profiles, so "New LLM Profile" named the wrong thing. Text Extractor and
OCR were already phrased this way.
…oltips

Agentic Table Extraction Settings came back empty every time it was
reopened: the saved Lite LLM adapter showed its placeholder, and the
three page fields showed defaults rather than what had been saved.

The modal fetches before it renders -- a spinner stands in for the
`<Form>` while the request is in flight -- so `setFieldsValue(fetched)`
lands while the form is still unmounted. Mounting then ran
`methods.reset(initialValues)` and discarded that write. antd merges the
other way round (`setValues({}, initialValues, this.store)` -- the store
wins), which is why the call-site worked before the migration. Seed
underneath the current values instead, skipping `undefined` so a field
RHF has merely registered keeps its initial value.

`tooltip` was never declared either, so every use fell into `...props`
and landed on the wrapper div: the marker never rendered and the config
object reached the DOM as an attribute. Accept both antd spellings -- a
bare node and `{ title, icon }` -- which restores the hints on the two
prompt-card settings modals, the manual-review rule editors and the
Stripe product form. The trigger is a real button because Radix opens on
hover AND focus, so a bare icon would hide the hint from keyboard users.
Ticking "Enable Postprocessing Webhook" and typing the URL within the
300ms toggle debounce unticked the box and dropped the URL input: the
URL save carried the `handleChange` from a pre-tick render, so its
optimistic `{...promptDetailsState}` re-asserted every other field as it
stood then. Each PATCH only carries its own field, so the server kept
both values and a refresh looked correct.

Write the field functionally, and roll back only that field on failure —
the same hazard applied to `active`, `required` and `profile_manager`.

Header re-seeded all four local fields whenever the `promptDetails`
object changed, so the toggle's own save landing mid-keystroke blanked
the URL the user was still typing. Key one effect per field on that
field's value; `details` fed none of them.
The adapter lists on the Default LLM Profile page grow with every adapter
an org configures, so picking one meant scrolling a list of near-identical
generated names. `showSearch` filters as you type; the shim's default
filter reads the option's own text, which is the adapter name, so no
filterOption is needed.
The Table shim presents antd's column API but silently dropped every filter
prop on it — `filters`, `filterDropdown`, `filterIcon`, `onFilter`,
`filteredValue`, `defaultFilteredValue`, `filterMultiple`, `filterSearch`. The
call-sites still declared them; nothing read them, so the headers rendered as
bare titles. The visible casualties are the three Execution Logs surfaces,
whose whole purpose is finding one execution among thousands: the Execution ID
search, the file-name search and the Status filter all disappeared. Logs &
Notifications, the LLMWhisperer dashboard, Lookup Usage and Manual Review lost
theirs the same way.

Sorting was wrong in the same place and for the same reason. antd reads the
sorter's SHAPE: a function is a local comparator, `sorter: true` means the
server sorts and the table should only report the click. Both sorted locally
with TanStack's guessed comparator and never called `onChange`, so every
`sorter: true` column reordered the ten rows already on screen while no request
went out — the logs list looked sorted and wasn't, since the rows that belonged
at the top were still on page two.

`sortDirections` was swallowed onto the wrapper div too, where React warned
about an unrecognised DOM attribute on every render of all four logs tables.
All four pass `["ascend", "descend", "ascend"]`, antd's idiom for a cycle that
never returns to unsorted.

One subtlety is worth naming because it is invisible until it bites: on commit,
a CONTROLLED column must report the keys the user just picked, not its own
`filteredValue`. That prop is the parent's current value — precisely the stale
one — so echoing it back is how the parent learns nothing changed. LogModal's
level filter is controlled on `selectedLogLevel` and sets it from this
callback, so it sat permanently on "no level".

Verified against a real deployment, not just the suite: the ID search, the
file-name search, the status filter's server round trip, the log-level filter
inside the modal, and `ordering=created_at` / `-created_at` on the wire.
`handleClearFilter` set the parent's level to null and then called `confirm()`,
which publishes whatever `setSelectedKeys` last set. That re-render had not
happened yet, so `confirm()` re-sent the level being cleared and the log list
stayed filtered. Empty the draft first. This one is antd's semantics too, not
an artefact of the shim, so Clear was broken before the migration as well.

The radio group also read `selectedKeys[0] || null`, and Radix treats a nullish
value as uncontrolled — picking the first level flipped it to controlled and
React warned. An empty string is the controlled spelling of "nothing selected".
A sortable column drew nothing until it was sorted, so on Execution Logs
neither "Executed At" nor "Execution Time" advertised that they sort, and
the lone chevron that appeared after a click read as decoration rather
than as state. Render antd's caret pair whenever `sorter` is set, greyed,
with the applied direction in the primary colour.

antd pins a column's affordances to the right edge of its header cell;
laying them inline after the title left each one wherever its own text
happened to end. The header is now a flex row with the title growing
(antd's `.ant-table-column-title { flex: 1 }`, which also keeps a centred
column's title centred) and the icons pushed to the trailing edge. The
flex row is conditional so a column with no affordance keeps its
alignment.

Not done here: antd also darkens the sorted column's header. Ten
stylesheets set `.ant-table-thead > tr > th { background }` at higher
specificity than a Tailwind utility, so that highlight would land on
some tables and silently not others.

Every custom `filterIcon` in the app is a bare lucide icon with no size,
so all four came out at lucide's 24px default and towered over the 12px
carets now beside them. The trigger sizes its own icon instead, as antd
does with `.ant-table-filter-trigger .anticon`.
react-day-picker renders a dropdown caption as a <select> PLUS a visible
label span carrying the same text — the select is meant to lie invisibly
over the span and take the clicks. Styling the select as the visible
control drew both, so the range picker's header read
"August August › 2026 2026 ›" per month and the doubled width slid under
the nav arrows.

So: `dropdown_root` is the bordered control users see, the select is a
transparent overlay on top of it, and the span supplies the text. The
focus ring hangs off `has-[:focus-visible]` because focus lands on the
select inside, not on the border.

The caption also reserves room for the arrows (`px-8`) rather than
centring into them, and the arrows sit at the top of a caption row that
is now their own height instead of at a hand-tuned offset.

`Chevron` only handled "left" and fell through to ChevronRight for
everything else — including the "down" the dropdowns ask for, so neither
the month nor the year control read as a dropdown. Map all four
orientations.
The Started / Ran for / Processed files cards were pinned to a fixed 60px
height while their bodies measured 66px — 88px once a timestamp wrapped — so
the card clipped its own content and "IST" rendered below the border, under
the table. Use min-height instead and let the row stretch.

The shim's card body carries Tailwind `p-6 pt-0`, which pinned the content to
the top edge and left 24px of dead space beneath it; centre it instead. That
also settles the icons, which sat at three different heights because each was
centred against a text block of a different size.

`.logging-card-icons` set only a margin, so the lucide SVGs ignored it and
fell back to their own 24px default — the same trap already documented on
`.column-settings-icon`, missed on this rule. Give them an explicit box.

Finally, line up the horizontal gutters: the title sat at 24px, the card row
at 0 and the table at 12px. All three now share one left and right edge.

The card row's `pad-12` class was only ever defined in the llm-whisperer
plugin's Playground.css, which never loads on this page, so it was inert.
Replace it with a real rule of its own.
Creating an API deployment from Prompt Studio could fail with "Tool does not
exist in registry: <uuid>" while the deployment itself went through on a
retry, leaving a sticky error toast next to a working deployment.

The modal resolved the exported tool from GET tool/ by matching
`tool.function_name === tool_id || tool.name === tool_name`. The first clause
is dead code — `function_name` is PromptStudioRegistry's own PK, never the
CustomTool id — so matching fell through to the display name, which goes stale
as soon as a project is renamed after export. On a miss the modal re-exported
and re-read the listing behind a hardcoded 1s timer, during which the wizard
stayed fully interactive with `toolFunctionName` still null; Create Deployment
then posted `toolFunctionName || toolDetails.tool_id`, i.e. the project id,
which the registry cannot resolve. Measured window on a dev server: ~1.2s,
comfortably wide enough for automation to click through.

Match on the `prompt_studio_tool_id` back-reference the listing publishes for
exactly this correlation, and never fall back to the project id: bail before
creating resources we would only roll back, and keep the primary action
disabled until the uid resolves. The export endpoint commits before it
responds, so the re-read no longer waits out a timer, and the retry budget is
threaded through the call rather than read from stale state. Key the effect on
the project id so store writes stop restarting the lookup chain concurrently.

Also stop the automatic export sending `is_shared_with_org: true`. It ran
whenever the name match missed and silently widened access to the project for
anyone who merely opened the modal; it now mirrors the private export
createApiDeployment already performs.
Each of these four declared its handler inline in the component body —
`const onSearchDebounce = debounce(fn, 600)`. That is a NEW debounced
instance on every render, so a render between two keystrokes orphans the
armed timer instead of resetting it: both eventually fire and the
"debounce" degrades to one call per keystroke. SonarCloud flags it as
javascript:S9114.

The re-render is the whole bug. These inputs are uncontrolled, so typing
alone does not re-render the component and even the inline version looks
correctly debounced; in the app the render arrives from somewhere else
(the parent committing the previous result, a context update, a sibling).
That is also why the new test supplies one explicitly — without it the
test passes against the bug, which it did until `rerender` was given a
fresh element rather than the same object React skips.

Memoising is only half of it. A `useMemo(..., [])` silences Sonar while
pinning the closure to its mount-time props, so each site got the deps it
actually needs: ListOfSources only calls a stable setState setter and
needs none; TopBar and ToolNavBar read props the filter depends on, so
they hold the latest callback in a ref; ConnectorListModal reads
`connectors` and keys on it.

ConnectorListModal also had to move above the effect that calls it: the
dep array is evaluated during render, so naming a `const` initialised
further down throws on the temporal dead zone rather than reading as
undefined.

Call sites now pass `event.target.value` instead of the event, so the
value is captured when the key is pressed rather than read off the live
DOM node 300-600ms later.
…attern

The tags-mode option list was the odd one out. SearchableSelect and
MultiSelect both give their listbox a `useId`, id each option from it,
and point the search input at the active one; the tags list had the
keyboard handling — the draft input's onKeyDown drives Arrow/Enter into
the same `commit` the onClick calls — but none of the ARIA that tells a
screen reader which option that is. SonarCloud flagged the options as
S1082/S6852 (click handler with no key handler, non-focusable `option`),
which is the same complaint its two siblings already answer with a
NOSONAR and an explanation.

So this brings it up to the pattern rather than suppressing it: listbox
id, per-option id, `aria-controls` and `aria-activedescendant` on the
input, and the sibling's note about why a key handler on the option would
be dead code.

Also adds the `aria-controls` S6807 wants alongside `aria-expanded` on
the two `role="combobox"` triggers.

Deliberately NO `role="combobox"` on the tags input itself, even though
that is the textbook ARIA 1.2 shape: it displaces the input's implicit
`textbox` role, which call-sites and this shim's own tests select it by,
and adding it broke 9 tests. The siblings do not carry it either.

Verified in a browser rather than from the diff: ArrowDown opens the list
and advances `aria-activedescendant` through ids that resolve, Enter
commits the chip and drops it from the remaining options, Backspace
removes it and puts it back.
`value === null || value === undefined` reads to SonarCloud as a
comparison that can never hold (javascript:S3403) because the inferred
type is `number`, whatever the JSDoc says. `value == null` covers both
cases in the one comparison Sonar asks for, and is the only `==` Biome's
noDoubleEquals allows.

Behaviour is unchanged: nothing else is loosely equal to null.
Two holes that let the group report success without exercising the app.

The specs run at the frontend's own origin and the app builds every API
URL from `window.location.origin` (`getBaseUrl()`), but the production
nginx config serves static files plus an SPA fallback and nothing else —
so `/api/v1/*` came back as index.html, session setup failed, and every
authenticated spec sat on the login screen while the document-only smoke
test still passed. A test-only nginx config, mounted over the container's,
proxies the three prefixes Traefik already routes to the backend. The
production config is untouched: it ships in an image where no `backend`
host resolves and nginx would refuse to start.

The compose stack does provide exactly this origin already, via the
Traefik labels on `backend` and `frontend`, but the rig cannot use it:
`*.localhost` resolves to ::1 for Node while compose publishes IPv4 only.
Measured, not assumed.

Second, `health_targets` omitted the frontend, so `_wait_ready` passed
with nothing on :3000 and `smoke.spec.js` turned the resulting navigation
error into a skip. The frontend is now probed (at `/` — it is nginx
serving a SPA, so index.html answering 200 is the liveness signal), and
the skip is gated on UNSTRACT_RIG_SESSION_ID: absent, a developer running
the specs bare still skips; present, the rig booted the stack and an
unreachable app is a real failure.

Note the mount path is relative to the PROJECT directory (docker/, from
the first -f), not to the overlay. Compose resolves every path against
the project dir, so a bare ./ silently resolves into docker/ and Docker
creates an empty directory at the target rather than erroring.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Frontend Lint Report (Biome)

✅ All checks passed! No linting or formatting issues found.

@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Unstract test results

Per-group results

Status Group Tier Passed Failed Errors Skipped Duration (s)
✅ e2e-api-deployment e2e 3 0 0 0 18.6
✅ e2e-coowners e2e 1 0 0 0 1.1
✅ e2e-etl e2e 1 0 0 0 8.8
✅ e2e-login e2e 2 0 0 0 0.9
✅ e2e-prompt-studio e2e 1 0 0 0 4.9
✅ e2e-smoke e2e 2 0 0 0 0.9
✅ e2e-workflow e2e 1 0 0 0 14.8
❌ frontend unit 0 1 0 0 0.0
✅ integration-backend integration 310 0 0 26 37.0
✅ integration-connectors integration 1 0 0 7 5.9
✅ integration-workers integration 157 0 0 1 41.7
❌ ui e2e 0 1 0 0 0.0
✅ unit-backend unit 1158 0 0 1 44.4
✅ unit-connectors unit 63 0 0 0 10.2
✅ unit-core unit 33 0 0 0 1.4
✅ unit-platform-service unit 15 0 0 0 2.7
✅ unit-rig unit 120 0 0 0 4.7
✅ unit-runner unit 5 0 0 0 3.0
✅ unit-sdk1 unit 563 0 0 0 30.6
✅ unit-workers unit 1397 0 0 1 132.0
TOTAL 3833 2 0 36 363.7

Critical paths

⚠️ Critical paths not yet covered

  • workflow-execution-fan-out — Multi-file workflow execution fans out to file-processing workers and rejoins. (declared coverage: no groups declared)
✅ Covered critical paths
  • auth-login — covered by e2e-login
  • adapter-register-llm — covered by integration-backend
  • workflow-author — covered by integration-backend
  • co-owner-manage — covered by integration-backend, e2e-coowners
  • workflow-create-execute — covered by e2e-workflow
  • api-deployment-provision — covered by integration-backend
  • api-deployment-auth — covered by integration-backend
  • api-deployment-run — covered by e2e-api-deployment
  • mcp-server-auth — covered by integration-backend
  • mcp-platform-auth — covered by integration-backend
  • prompt-studio-author — covered by integration-backend
  • prompt-studio-fetch-response — covered by e2e-prompt-studio
  • connector-register-test — covered by integration-backend
  • pipeline-etl-execute — covered by e2e-etl
  • usage-aggregate-read — covered by integration-backend
  • usage-token-tracking — covered by e2e-api-deployment
  • callback-result-delivery — covered by e2e-api-deployment

@jaseemjaskp
jaseemjaskp merged commit c49968e into main Sep 1, 2026
11 checks passed
@jaseemjaskp
jaseemjaskp deleted the feat/shadcn-oss-migration branch September 1, 2026 09:00
kirtimanmishrazipstack added a commit that referenced this pull request Sep 10, 2026
…-only

Main moved past this branch with UN-4046 (PG queue out of the pg_queue_enabled
flag) and #2212 (Ant Design out of the OSS frontend). Three things needed
resolving:

- CoOwnerManagement.jsx: the only textual conflict. Kept this branch's staged
  co-owner roster (removals wait for Apply) on top of main's shadcn shim imports
  and lucide icons.

- share_notifications._dispatch imported resolve_transport from
  workflow_manager.workflow_v2.transport, which UN-4046 deleted — it would have
  raised ImportError on the first share. It now enqueues on the PG queue
  directly, mirroring notification_dispatch. entity_id existed only to give
  resolve_transport a sticky id, so it is gone from _dispatch_quietly, both
  callers, and the two assertions that read it.

- workers/notification: the in-task retry loop was justified by "on Celery a
  raise is terminal". Celery is gone; the loop stays because it absorbs a brief
  backend blip in-process rather than costing a lease-expiry redelivery plus one
  of the consumer's bounded attempts.

Verified: manage.py check clean (warnings all pre-existing shapes), 11 unit +
36 integration tests pass across test_share_notification_dispatch,
permissions/tests/test_share_notifications and tenant_account_v2/tests,
pre-commit clean on the touched files, frontend build succeeds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfrKHgSfDQxaXwJWrMxUWG
vishnuszipstack added a commit that referenced this pull request Sep 18, 2026
… so nested cell values expand again (#2288)

* UN-4124 [FIX] Implement antd's expandable on the shared DataTable

The Ant Design removal (#1683 / #2212) replaced `<Table>` with the shared
DataTable, which never implemented antd's `expandable` API. Undeclared, the
whole object fell into `...props` and was spread onto the wrapper <div>, where
React ignores it — so `expandedRowRender` was never called and the table
rendered as if the prop had not been passed, with no console error.

HITL's review editor is the visible casualty: an array or object inside a table
cell shows a truncated JSON blob with an expand button beside it, and clicking
that button did nothing at all, leaving nested values unreadable in Table view.

Support `expandedRowRender`, controlled `expandedRowKeys` and uncontrolled
`defaultExpandedRowKeys`, `rowExpandable`, `showExpandColumn`, `expandIcon`,
`expandedRowClassName`, `onExpand` and `onExpandedRowsChange`. The panel is a
sibling <tr> spanning every column, since a row may only contain cells.

Keys are compared as strings because that is what TanStack's `getRowId` (and so
`row.id`) produces: a call-site numbering its rows `key: index` passes numbers,
and `[0].includes("0")` is false — a mismatch that would have hidden every
expansion on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* UN-4124 [FIX] Report expansion keys in the caller's own type

Review feedback on #2288.

`onExpandedRowsChange` built its argument from the internal `expandedKeys`
set, which is normalized with `.map(String)` so it can match TanStack's
`row.id`. That normalization leaked out: a controlled caller that passed
`[1]` was handed back `["1"]`, and a parent testing `includes(1)` against it
would never match.

Normalization is now strictly internal. The reported array is built from the
caller's own keys — `controlledExpandedKeys ?? ownExpandedKeys` — appending
`originalRowKey()`, which reverses `getRowId`'s stringification by reading
`rowKey` off the record directly. Collapse compares with `String(k) !== key`
so it can filter a normalized id out of an un-normalized list without
rewriting the survivors' types.

Expansion itself is unaffected: `expandedKeys` is still a string Set, so
matching behaves exactly as before. `defaultExpandedRowKeys` no longer
stringifies on the way into state, since the memo normalizes anyway.

Both directions are covered and mutation-checked: stringifying the appended
key fails the expand test, and filtering the normalized set fails the
collapse test.

Also addresses SonarCloud S9020 — `waitFor` + `getByText` becomes
`findByText` in the nested-panel test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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