Skip to content

[Chakra exit · Phase 3 · PR 14] frontend: delete the dead Chakra and antd CSS - #2651

Open
SpicyPete wants to merge 7 commits into
chakra-exit/13-remove-dependencyfrom
chakra-exit/14-css-cleanup
Open

[Chakra exit · Phase 3 · PR 14] frontend: delete the dead Chakra and antd CSS#2651
SpicyPete wants to merge 7 commits into
chakra-exit/13-remove-dependencyfrom
chakra-exit/14-css-cleanup

Conversation

@SpicyPete

@SpicyPete SpicyPete commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What

Phase 3, PR 14 — the last PR of the Chakra exit. Stacked on #2650 (PR 13); review that first.

Deletes the stylesheet residue that nothing can match now that Console renders no Chakra component, and corrects the record on the three interop hacks that have to stay.

Deleted

Rule File Why it is dead
nav.chakra-stack, nav.chakra-breadcrumb index.scss Console has no Chakra nav. Both are unlayered, so embedded they were reaching the host's nav — removing them fixes a leak as well as dead weight. Carried the comment "Console adjustments to be removed later - Dan added the below".
body.chakra-ui-dark { .statisticsBar } index-cloud-integration.scss Dead twice over — .statisticsBar is rendered by no component, and this was the last --chakra-colors-gray-800 reference.
.reassignPartitions .ant-* (3 rules) index.scss antd left the codebase long ago; no source emits an ant- class.
Commented-out .ant-* block Wizard.module.scss Same, and already commented out.

What I did not delete, and why this is the interesting part

The plan of record had this PR remove the three globals.css Chakra hacks. Checking cloud-ui says it cannot, yet. apps/cloud-ui still mounts its own ChakraProvider on @redpanda-data/ui@4.2.0, so Chakra is still in the embedded document after PR 13 — it now arrives from the host, not from us.

That matters unevenly across the three:

  1. [class*="chakra-"] { border-color: transparent } — deleted, after two rounds of review corrected me twice. I first argued it was the document's only copy and load-bearing for the host. That was wrong: it sits in @layer base, and cloud-ui mounts ChakraProvider with no disableGlobalStyle, so Chakra's GlobalStyle still emits its *, ::before, ::after border reset unlayered, outranking any layered rule. I then kept it as "the fallback for a host that drops that reset" — also wrong, and worse: since Console renders no chakra-* class, the rule's only possible targets are the host's Chakra nodes, so the day cloud-ui drops its reset this rule becomes the winning declaration and forces transparent borders onto cloud-ui's own components. Console's stylesheet overriding the host's, not protecting it. So two host-only hacks remain, not three.

  2. --chakra-colors-chakra-border-color repoint and 3. [class*="border-"] { border-color: revert-layer } are duplicated value-identically in cloud-ui, whose own comment says "Must stay in step with console's globals.css: two apps in one document diverging here makes the winner depend on load order." They are inert standalone. Removing them would leave Console's embedded correctness depending on the host's stylesheet continuing to carry them.

So all three stay, and I rewrote their comments to say what is now true — that they are embedded-only, which copy is load-bearing, and that they go with cloud-ui's Chakra exit. A stale comment claiming Console's own Chakra injects the reset is worse than the rule itself.

apps/admin-ui also carries a Chakra bridge but does not embed Console, so it is unaffected either way.

This is the paired cross-repo change the tracker always said it was — it just turns out the pairing runs the other way. The precondition is cloud-ui's own Chakra exit, not a simultaneous CSS edit. Happy to open the cloud-ui side if you want the two to land together.

Also unchanged, as planned: the index.scss toast-viewport block, which waits on an upstream position prop.

Review

Reviewed at high effort; nine findings, six applied (see the fix(review): commit). The one that mattered invalidated this PR's own central claim — see item 1 above. Two more were stale records in files this PR already touched: index-cloud-integration.scss's header said its rules "can be removed when ant design is removed", which my own premise makes actionable even though they govern Console's #mainLayout scroll container; and wizard.tsx renders className={styles.wizard} for a class that only ever existed inside the commented-out block I deleted, so it has always been undefined.

One finding I reverted rather than applied. The review found five dangling var(--ant-primary-color) references the antd sweep missed — nothing in the repo defines that variable — and rewrote them to a registry token. That is a real bug, and I have filed it, but not fixed it here: because the variable is undefined those declarations are invalid at computed-value time and fall back to currentColor, so substituting a colour changes what live surfaces render.hoverLink on the connect cluster/connector tables, .linkBtn, and the reassignment spinner's two-tone border, which currently gets its accent from currentColor by accident. Which accent those should use is a design call, and a visual change does not belong in a PR whose whole contract is deletion. One-line follow-up if you want it.

Second review, on the full stack

Reviewed again with both PRs as one diff against master. Ten findings, six applied. In this PR: the globals.css deletion above, and my index-cloud-integration.scss header — I had implied the file is embedded-only and that an embedded check suffices to drop it, when app.tsx imports it standalone too and #mainLayout renders in every mode.

Two findings left as flags because fixing them changes rendering, which this PR's contract excludes:

  • body { font-family: "Inter" !important } in index.scss, four lines from the nav.chakra-* rules I deleted — an unlayered body selector with !important, so embedded it re-fonts the whole cloud-ui shell. Exactly the leak class I used to justify those deletions, and the largest instance of it. Retargeting it is a host-pair visual decision.
  • The five var(--ant-primary-color) references, as before.

Third review — dead code, comments, semantic colours

Reviewed again against those three axes. Fifteen findings, twelve applied.

The reported dark-mode bug and its family. .labelText was rgba(0, 0, 0, 0.45) — near-invisible on a dark ground, which is why "FORMATTING" and "SORT" on Broker Details read as black-on-black while the Stat labels beside them were fine. It turned out to be declared twice in index.scss; I fixed one half and review caught the other, which also hardcoded color: red for the required-field asterisk. And .currentReassignments .title carried the byte-identical properties of the dead .h3 rule I had just deleted — same defect, but live.

Nine more live classes came off literals (faithful neutral mappings, not retoning): the two .iconButton blocks, .messageHeaders, .brokerTagList and its tags, .footer, .editorLoading, .previewTag .path, plus .hoverLink which pointed at the undefined var(--ant-primary-color). index.scss goes from 82 hardcoded colour declarations to 56, with no near-black text colour left, and the dangling antd variable is gone from the codebase entirely.

Two Registry contract violations. .currentReassignments button painted a hardcoded pale-blue fill and hover onto <Button variant="link">; being unlayered it beat the variant's own layered classes. And .cursor-pointer/.capitalize were hand-rolled duplicates of Tailwind utilities that, being unlayered, defeated layered variants like disabled:cursor-default on the same element. All deleted.

Left for a separate pass, deliberately:

  • globals.scss's unlayered h2, b and body resets. These outrank @layer utilities, so text-heading is inert on <h2> across ~14 call sites — and because only app.tsx imports that file, standalone and embedded Console render different typography. The fix is to wrap them in @layer base, but that changes type across many pages and wants a visual pass.
  • ~46 more unreferenced index.scss class blocks. Verified zero references, but CSS deletions are invisible to type-check, lint and tests, so they deserve their own reviewable commit rather than riding along here.

Gates

  • theme:check ok — 0 semantic overrides across 0 roles, 161 registry roles deliberately inherited, no dead names
  • type:check clean
  • bun run build green
  • 997 unit + 1438 integration passing
  • The built CSS chunk no longer contains ant-steps, ant-table-expanded, nav.chakra-stack, chakra-breadcrumb, chakra-ui-dark, statisticsBar or chakra-colors-gray-800. What remains is exactly the two documented host-only hacks — the built CSS carries a single chakra string, the --chakra-colors-chakra-border-color repoint.

Still wants a human

An embedded Cloud UI pass, for the same reason as PR 13 — this touches the stylesheet that is shared with the host, and nothing in this repo renders Console inside cloud-ui.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Clean — no registry drift, off-token colours, or ad-hoc classes

App: frontend · Scope: diff vs origin/chakra-exit/13-remove-dependency · Files: 13

Count
⚠️ Outdated registry components 0
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0

Generated by lookout audit-changes.

@SpicyPete
SpicyPete force-pushed the chakra-exit/14-css-cleanup branch 3 times, most recently from d5d61ba to 4492faf Compare September 11, 2026 20:29
@SpicyPete SpicyPete changed the title [Chakra exit · Phase 3 · PR 14/16] frontend: delete the dead Chakra and antd CSS [Chakra exit · Phase 3 · PR 14] frontend: delete the dead Chakra and antd CSS Sep 11, 2026
@SpicyPete SpicyPete self-assigned this Sep 11, 2026
@SpicyPete
SpicyPete requested review from a team, Mateoc, datamali, r-vasquez and yougotashovel and removed request for a team September 11, 2026 21:24
@SpicyPete
SpicyPete marked this pull request as ready for review September 11, 2026 21:24
@SpicyPete
SpicyPete force-pushed the chakra-exit/14-css-cleanup branch from 6312c99 to b550688 Compare September 11, 2026 21:49
SpicyPete and others added 4 commits September 11, 2026 15:03
…antd CSS

Removes the stylesheet residue that nothing can match now that Console
renders no Chakra component:

- `nav.chakra-stack` / `nav.chakra-breadcrumb` (index.scss). Console has no
  Chakra nav, and both are unlayered, so embedded they reached the host's.
- `body.chakra-ui-dark { .statisticsBar }` (index-cloud-integration.scss).
  Dead twice over: `.statisticsBar` is rendered nowhere, and this was the
  last `--chakra-colors-gray-800` reference.
- The `.reassignPartitions .ant-*` rules (index.scss) and the commented-out
  `.ant-*` block in Wizard.module.scss. antd left the codebase long ago and
  no source emits an `ant-` class.

The three globals.css interop hacks STAY, with comments corrected to say why:
they are embedded-only now, not Console's own. cloud-ui still mounts its own
ChakraProvider on @redpanda-data/ui@4.2.0, and its globals.css has no
equivalent of the `[class*="chakra-"] { border-color: transparent }` guard —
so Console's copy is the only one in the embedded document and is what keeps
the HOST's Chakra components from painting stray borders under Tailwind v4
Preflight. The other two are duplicated value-identically in cloud-ui, whose
own comment requires the pair stay in step. All three go with cloud-ui's
Chakra exit, in a paired change.

Also unchanged, as planned: the index.scss `toast-viewport` block, which
waits on an upstream position prop.

Gates: theme:check ok, type:check clean, build green, 997 unit + 1438
integration passing. The built CSS chunk no longer contains ant-steps,
ant-table-expanded, nav.chakra-stack, chakra-breadcrumb, chakra-ui-dark,
statisticsBar or chakra-colors-gray-800.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Self-review: removing the nav.chakra-* block left a double blank line in
index.scss, and removing the body.chakra-ui-dark block left a trailing blank
line at the end of index-cloud-integration.scss.

Wizard.module.scss has both of those too, but they predate this branch —
verified against the parent commit — so they stay untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The sharpest finding invalidated this PR's own reasoning, so the comments are
rewritten rather than merely re-scoped.

globals.css — I had claimed the `@layer base { [class*="chakra-"] {
border-color: transparent } }` rule is what stops the embedded host's Chakra
components painting stray borders, and must therefore stay. That is wrong: the
rule is layered, and cloud-ui mounts ChakraProvider with no disableGlobalStyle,
so Chakra's GlobalStyle still emits its `*, ::before, ::after` border reset
UNLAYERED — which outranks every layered rule regardless of specificity.
Verified in cloud-ui's provider. The rule is inert today; it is the fallback
for a host that drops that reset while keeping the components. Also dropped
the claim that the `revert-layer` rule "is inert standalone, where nothing
unlayered outranks the layers" — index.scss, globals.scss and every
*.module.scss are unlayered, and globals.css is imported after index.scss.
All three comments are back to roughly their pre-PR length.

Wizard.module.scss / wizard.tsx — `.wizard` only ever existed inside the
commented-out block, so `styles.wizard` has always been undefined and the root
div has always shipped classless; removed the dead reference. `.steps` and
`.step` have no `styles.` consumer either.

index-cloud-integration.scss — the header claimed its rules "can be removed
when ant design is removed", which this PR's own premise makes true and
actionable; they in fact govern Console's `#mainLayout` scroll container.

Also re-indented `.reassignPartitions`, whose first children were the deleted
antd rules, and corrected the toast-viewport comment to name the host's Chakra
modals.

Not applied: the review also rewrote five dangling `var(--ant-primary-color)`
references to a registry token. Reverted — the variable is undefined, so those
declarations are invalid at computed-value time and fall back to currentColor,
which means substituting a colour changes what live surfaces render
(`.hoverLink` on the connect pages, `.linkBtn`, the reassignment spinner's
two-tone border). That is a visual fix inside a deletion PR, and which accent
they should use is a design call. Filed instead.

Gates: theme:check ok, type:check clean, build green, 997 unit + 1438
integration passing, no lint drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review of the full Phase 3 stack, two findings in this PR's own files.

globals.css — deleted `@layer base { [class*="chakra-"] { border-color:
transparent } }`. I kept it as "the fallback for a host that drops its reset
while keeping its components", which inverts what it would actually do: since
Console renders no chakra-* class, the rule's only possible targets are the
HOST's Chakra nodes in the shared document. On the day cloud-ui drops its
unlayered `*` border reset, this layered rule becomes the winning declaration
and forces every host Chakra component to paint a transparent border. That is
not a fallback for Console; it is Console's stylesheet overriding the host's.
Two documented host-only hacks remain, not three.

index-cloud-integration.scss — my rewritten header implied the file is
embedded-only and that an embedded check is enough to drop it. Wrong on both:
app.tsx imports it standalone as well as embedded-app.tsx and
federation/console-app.tsx, and `#mainLayout` is rendered by routes/__root.tsx
in every mode, so `background: transparent !important` and the margin reset are
live standalone. Dropping them needs both modes checked.

Gates: theme:check ok, type:check clean, build green, 997 unit + 1438
integration + 1 federation passing. The built CSS chunk now contains exactly
one chakra string, the `--chakra-colors-chakra-border-color` repoint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@SpicyPete
SpicyPete force-pushed the chakra-exit/14-css-cleanup branch from b550688 to 2d46d25 Compare September 11, 2026 22:03
@SpicyPete
SpicyPete marked this pull request as draft September 11, 2026 22:21
SpicyPete and others added 3 commits September 11, 2026 15:27
The uppercase field labels (`.labelText`, 11 call sites — "FORMATTING" and
"SORT" on Broker Details among them) were `rgba(0, 0, 0, 0.45)`: near-invisible
on a dark ground, while the `Stat` labels beside them read correctly because
they take a token. Now `var(--color-muted-foreground)`, which resolves #606164
light / #9c9c9c dark.

Same class of bug in `.topicDocumentation` (live, tab-docu.tsx): its `<pre>`
was `#333` on `#f5f8fb` and its tables had a hardcoded border and zebra fill,
so the whole documentation surface stayed light. Now `--color-foreground`,
`--color-surface-recess` and `--color-border`.

`.hoverLink:hover` (live on the connect cluster and connector tables) pointed
at `var(--ant-primary-color)`, which nothing defines — invalid at
computed-value time, so it resolved to `currentColor` and the hover accent
never appeared. Now `var(--color-action-primary)`, the role the Registry's own
link variants use.

Deleted six rule blocks no className in `src` reaches: `tr.tombstone`,
`tr.consumerGroupNoMemberAssigned`, `.h3`, `.errorPartition td`, `.linkBtn`
and `.partitionReassignmentSpinner` — the last two of which held the remaining
`--ant-primary-color` references, so **that dangling antd variable is now gone
from the codebase entirely**, closing the §04 item rather than deferring it.
The spinner's only reference was a commented-out `return` in
`active-reassignments.tsx`, removed with it.

Also dropped the commented-out declarations inside the `.labelText` blocks and
the dead commented-out `<label>` JSX in `tsx-utils`' `Label`.

Net 90 lines out, 6 in. No hardcoded near-black text colour remains in
index.scss.

Gates: theme:check ok, type:check clean, build green, 997 unit + 1438
integration passing, no lint drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`connect/helper.tsx` defines five status icons in one block and only the first
was semantic:

    okIcon    = <CheckCircleIcon className="text-success" />   ← already right
    warnIcon  = <WarningIcon color="orange" />
    errIcon   = <AlertIcon color="orangered" />
    waitIcon  = <HourglassIcon color="#888" />
    pauseIcon = <span style={{ color: '#555' }}><PauseCircleIcon /></span>

All four literals are live — warnIcon on the connector/task health summaries,
errIcon on the connect overview, waitIcon and pauseIcon on the connector
status icon — and none of them tracks the theme. Now `text-warning`,
`text-destructive` and `text-muted-foreground`, matching okIcon. pauseIcon's
wrapper span goes with it, since the class lands on the icon directly.

Also `payload-component.tsx`'s expanded-message error was
`style={{ color: 'red' }}`; `text-destructive` is what the other 65 call sites
use.

Gates: type:check clean, build green, 997 unit + 1438 integration passing, no
lint drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review of the full stack, focused on dead code, comment length and correct
component/colour usage. It found the label bug had a twin I had missed and
several siblings of the same shape.

**The twin.** `.labelText` is declared TWICE in index.scss — I fixed the
colour in the first block and left the second, which also hardcoded
`color: red` for the required-field asterisk. Blocks merged, asterisk on
`--color-destructive`. And `.reassignPartitions .currentReassignments .title`
carried the byte-identical properties of the dead `.h3` rule I deleted —
`rgba(0, 0, 0, 0.85)`, invisible on a dark ground, and live (the "Current
Reassignments" heading). Now `--color-strong`.

**Seven more live classes off literals**, all faithful neutral mappings:
`.iconButton` and `.groupDetails .iconButton` (icon ink, hover ink, press
washes), `.messageHeaders` hairline, `.brokerTagList` and its tags,
`.footer`, `.editorLoading`'s scrim, and `.previewTag .path`. Hardcoded colour
declarations in index.scss: 82 → 56, with no near-black text colour left.

**Registry contract violations removed.** `.reassignPartitions
.currentReassignments button` painted a hardcoded pale-blue fill and a
light-blue hover onto `<Button variant="link">` — unlayered, so it beat the
variant's own layered classes. Deleted; the Button paints itself.
`.cursor-pointer` and `.capitalize` were hand-rolled duplicates of Tailwind
utilities, and being unlayered they defeated layered variants like
`disabled:cursor-default` on the same element. Deleted — verified Tailwind
still emits both from its 109 call sites.

**Dead code.** The 40-line `.react-json-view` block (the package is not a
dependency; kowl-json-view renders Monaco), `.sider`/`.sideBar`/
`.sideBarToggle`, `.menu-divider`, `.query-form`, `.error-list`, an empty
`.versionTitle {}`, and the Wizard's `getSteps`/`isLast` contract — dead once
PR 14 deleted the `display: none` step list they fed, along with the two
call-site implementations in create-connector.tsx.

**Comments trimmed** where they had grown into decision records: the `.snyk`
reason back to its reachability claim, the `<button>`-nesting suppression from
10 lines to 3, the two `globals.css` Chakra blocks 14 → 11, and a stale line
in the de-flaked test describing a blur it never performs. `schema-create.tsx`
was corrected outright — its override is needed standalone too, because
Console's own `@layer base { svg { display: inline-block } }` is what
off-centres the icons, not the host's Chakra.

Gates: theme:check ok, type:check clean, build green, 997 unit + 1438
integration passing, no lint drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@SpicyPete
SpicyPete marked this pull request as ready for review September 11, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant