Skip to content

[Chakra exit · Phase 2 · PR 15] frontend: the topics pages on Registry components, plus a settings-dialog spec - #2647

Open
SpicyPete wants to merge 7 commits into
masterfrom
chakra-exit/10-topics
Open

[Chakra exit · Phase 2 · PR 15] frontend: the topics pages on Registry components, plus a settings-dialog spec#2647
SpicyPete wants to merge 7 commits into
masterfrom
chakra-exit/10-topics

Conversation

@SpicyPete

Copy link
Copy Markdown
Contributor

Takes pages/topics off Chakra — all nine remaining files. master goes 28 → 19, leaving only the four security tabs (#2604) and PR 13's own five.

Stacked conceptually after #2645 (rp-connect) but independent of it: disjoint files, opened off master, merges in either order.

Why this is not the throwaway work the plan assumed

The tracker has said for a week that these nine "go with the legacy view once enableNewTopicMessagesPage flips". A reverse-dependency check says otherwise. Tab.Messages is not a self-contained legacy view — it is a shared library, with eight modules imported from outside the directory, including by the new messages page that replaces it.

Five of the nine survive the flag flip, and three are rendered by page areas already marked done:

File Reached from
tab-docu.tsx topic-details.tsx — the Documentation tab, never behind the flag
message-display/message-preview.tsx transforms (PR 5), connector-details (PR 11), pipelines-details (PR 9)
common/empty-badge.tsx via message-preview
common/empty-icon.tsx via expanded-message → message-headers, same three pages
preview-settings.tsx the new page's messages/table/message-cells.tsx imports getPreviewTags

So MessagePreview has been painting Chakra <Flex>/<Text> — with red.600, blue.500, gray.500 — in the Value column of three logs tables since their own migrations merged. The importer metric could not see it: the imports live under topics/, so they were booked against the topics bucket while those pages counted as clean. Worth stating once: "0 importers" is the right gate for removing the dependency, and the wrong one for "is this page migrated".

The remaining four (message-key-preview, modals/column-settings, modals/preview-fields-modal, preview-settings/pattern-help-drawer) really are legacy-only. I migrated them anyway — PR 13 cannot merge while anything imports the package, and the flag flip has no date. That work is deliberately spent so the flip stops being a gate.

Reviewer's guide

Change What to look at
Colour props → tokens red.600text-destructive, blue.500text-informative, gray.500text-muted-foreground. These were color= props on Chakra components, so they worked; in Registry they need semantic classes.
Tooltip → compound empty-icon keeps its instant open — Chakra had openDelay={1}, and the Registry would otherwise inherit Base UI's 600 ms.
opacity-[0.66] Not opacity-66. A bare number depends on v4's dynamic scale; an arbitrary value is guaranteed to emit, and a silently-inert opacity is the exact trap this series keeps hitting.
Two ModalDialog Both keep the PortalContainerProvider from the Chakra original, so the nested select and popover still portal inside the dialog's focus and scroll lock rather than to the body.
DrawerSheet placement="right" size="xl"side="right" size="xl"; the body scrolls via overflow-y-auto on the content.
Checkbox Chakra's took its label as a child and wired it; the Registry's does not. Every box now has an explicit id + Label, or an aria-label where the original had no visible text at all — the pattern-enable box in preview-settings had none.
Empty Empty description={title}Empty + EmptyHeader + EmptyTitle, with w-full because the Registry root has no width of its own.

Removed rather than ported

  • A Popover with no trigger child in preview-settings (content={globHelp} trigger="click", self-closing). It rendered nothing clickable and had no way to open — the adjacent PatternHelpDrawer provides the real glob-pattern link. Porting it faithfully would have meant a Registry Popover with an empty trigger.
  • The dead rs.mock('@redpanda-data/ui') block in message-display.test.tsx. With these components off Chakra it mocked nothing. Dropping it means those four tests now exercise the real components instead of plain divs — same four passing, strictly better coverage.

Coverage

Four specs already drive the legacy messages view (filtering, production, timestamps, navigation), so MessagePreview and MessageKeyPreview have real regression cover. None of them opened the three settings surfaces, which are the riskiest part of this diff — two dialog conversions and a drawer.

topic-messages-settings-dialogs.spec.ts covers them: the column-settings dialog opens, its checkboxes resolve by name (the contract Chakra used to provide), it closes; and the preview-fields dialog opens the glob-pattern sheet nested inside it. Verified green against a live container. It caught one real thing while being written: DialogContent renders its own close X with aria-label="Close", so a role-by-name query matches two buttons.

Gates

type:check clean · lint:check clean on all 11 changed files · 993 unit · 1425 integration · the new e2e spec passes in the console variant.

Flagged, not fixed

  • preview-settings.tsx is still imported by the new page for one function. getPreviewTags is a pure helper sitting in a 543-line component module. Extracting it would let the new page stop importing a component module entirely; left alone here because the module is now Registry-based either way, so it is hygiene rather than a dependency problem.
  • The four legacy-only files should be deleted, not kept, when the flag flips. They are migrated so they cannot block PR 13, not because they are worth keeping.

🤖 Generated with Claude Code

SpicyPete and others added 3 commits September 10, 2026 08:06
These four outlive the enableNewTopicMessagesPage flag, so migrating
them is not throwaway work. Three of them are rendered by page areas
already marked done: MessagePreview paints the Value column of the logs
tables on transforms, connector-details and pipelines-details, and
renderEmptyIcon reaches the same three through expanded-message ->
message-headers. Those pages have carried Chakra at runtime since their
own migrations merged — the metric counts imports per file, and these
imports live under topics/.

tab-docu is the topic Documentation tab, which was never behind the
flag at all.

Chakra's colour props become semantic tokens: red.600 -> text-destructive,
blue.500 -> text-informative, gray.500 -> text-muted-foreground. The
empty-icon tooltip keeps its instant open (Chakra had openDelay={1};
the Registry would otherwise inherit Base UI's 600ms) and an exact
opacity-[0.66] rather than a bare opacity-66, which depends on v4's
dynamic scale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The four files that only the flag-off view reaches: two Chakra Modals
become Registry Dialogs, the glob-pattern Drawer becomes a Sheet, and
the preview-settings popover becomes a Registry Popover. Both dialogs
keep the PortalContainerProvider from the Chakra original so their
nested select and popover still portal inside the dialog's focus and
scroll lock.

Chakra's Checkbox took its label as a child and wired it; the Registry's
does not, so every box now has an explicit id + Label, or an aria-label
where the original had no visible text at all.

Removed rather than ported: a Popover with no trigger child in
preview-settings, which rendered nothing clickable and had no way to
open. Also removed the dead `rs.mock('@redpanda-data/ui')` block in
message-display.test.tsx — with these components off Chakra it mocked
nothing, and dropping it means those four tests now exercise the real
components instead of plain divs.

Adds a spec for the two dialogs and the sheet: four specs already drive
the legacy messages view, but none of them opened these, and a dialog
that fails to open is invisible to the type checker.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DialogContent renders its own close X with an aria-label of "Close", so
a role query by name matches it as well as the footer button. Only the
footer button carries the text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

App: frontend · Scope: diff vs origin/master · Files: 11

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 changed the title [Chakra exit · Phase 2 · PR 10/14] frontend: the topics pages on Registry components, plus a settings-dialog spec [Chakra exit · Phase 2 · PR 15] frontend: the topics pages on Registry components, plus a settings-dialog spec Sep 10, 2026
@SpicyPete
SpicyPete requested review from a team, c-julin, datamali, r-vasquez and yougotashovel and removed request for a team September 10, 2026 15:24
@SpicyPete SpicyPete self-assigned this Sep 10, 2026
SpicyPete and others added 4 commits September 10, 2026 08:36
… they did

The portal-container wrapper inside DialogContent was a plain block, so
DialogBody's `flex-1` and its own scrolling were inert: tall content was
clipped by the popup's max-height instead of scrolling, and the footer could
be pushed out of view. The wrapper is now the flex column DialogBody expects.

SheetContent is likewise not a flex column, so the drawer's header scrolled
away with the body and SheetFooter's flex-col stretched the lone Close button
across the panel. Made the content a column, scrolled only the body, and
right-aligned the footer as the Chakra Drawer's was.

Also dropped a redundant `w-full` on Empty, whose root already ships one, and
the comment that claimed otherwise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
noLeakedRender's sibling rule useTopLevelRegex fires on an inline regex in
a locator; the reassign spec already keeps its matchers as module constants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four behaviour findings from the review of #2647:

- the glob-pattern Sheet honoured the enclosing dialog's
  PortalContainerProvider, so it mounted inside DialogContent — which
  is transformed and `overflow-hidden`, making it both the containing
  block and the clipping ancestor for a fixed panel. The help was
  therefore sized and clipped to the dialog box rather than covering
  the viewport, as the Chakra Drawer did. `container` opts out.
- `size="xl"` was not the like-for-like it looked like: Chakra's drawer
  scale maps `xl` to 56rem, the Sheet's to 36rem. The width is now set
  explicitly, with `size="full"` dropping the variant's own cap.
- `fontSize` never sized the lucide warning and info icons, so master
  rendered them at 24 and `size={16}` shrank them by a third — in the
  messages table and in the transforms, connector-details and
  pipelines-details logs tables.
- tab-docu's documentation button lost Chakra's `solid` fill to the
  Registry's neutral default.

The spec grows a guard that the Sheet is not a descendant of the
dialog; `toBeVisible` cannot see overflow clipping. It also stops
locating dialogs by role: Base UI's Toast.Root is a role=dialog too, so
`getByRole('dialog')` matched the messages tab's own "Searching..."
toast whenever it was still up, and the spec failed roughly half the
time on a strict-mode violation. Scoped by slot it passes 8/8 with
--repeat-each=4. Both tests now delete the topic they create, as the
eight sibling topic specs do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment-only. The spec preamble and the Sheet and portal-container
notes had grown into rationale; each is now the constraint alone, with
the reasoning left to the PR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@r-vasquez r-vasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

Tested locally and all loogs good.
Image

Image

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