refactor(ideal): extract value-derived Tabs UI helpers#684
Conversation
📝 WalkthroughWalkthroughIntroduces a self-contained ChangesTabs Cell Implementation and Wiring
Sequence Diagram(s)sequenceDiagram
participant Parent as Parent Cell
participant make_tabs_cell as make_tabs_cell
participant tabs_Model as `@tabs.Model`
participant view_bottom as view_bottom_tabs
Parent->>make_tabs_cell: TabActivated(index)
make_tabs_cell->>make_tabs_cell: bounds-check index
make_tabs_cell->>tabs_Model: `@tabs.Model`::new(id, tab_count, selected)
make_tabs_cell->>Parent: on_select(tab_id) batched with focus_cmd
Parent->>make_tabs_cell: SetSelected(index)
make_tabs_cell->>make_tabs_cell: bounds-check, update selected_index
view_bottom->>make_tabs_cell: tablist_view + tab_trigger_view per tab
make_tabs_cell-->>view_bottom: rendered `@html.Html`
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lambda-editor | ff17b70 | Commit Preview URL Branch Preview URL |
Jun 16 2026, 01:54 PM |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/agents/tailwind-plus-rabbita.md`:
- Around line 11-13: Add a language tag to the fenced code block containing
"reference/tailwind-plus/ui-blocks/" to satisfy markdownlint. Change the opening
fence from a bare triple backtick to triple backtick followed by "text" (e.g.,
```text) to specify the content format while keeping the content unchanged. This
satisfies the markdownlint requirement for fenced code blocks to have a language
identifier.
In `@examples/ideal/main/ui/tabs.mbt`:
- Around line 160-172: Replace the imperative for loop that pushes to the
mutable triggers array with a declarative array construction method. Instead of
using a for loop with push operations on tabs, use MoonBit's functional array
methods such as Array.mapi to create the triggers array in one expression. The
mapi function should iterate over the tabs with their indices and return
tab_trigger_view results directly, eliminating the need for imperative mutation.
Assign the result of this declarative mapping directly to triggers rather than
building it incrementally with push calls.
In `@examples/ideal/main/view_bottom_classes.mbt`:
- Around line 2-4: Update the comment in the bottom-panel tab strip chrome
ownership section to reference the correct symbol name. The comment currently
references canopy_tabs_container_class, but the actual API exported from
main/ui/tabs.mbt is tabs_container_class(). Replace the incorrect symbol
reference with the correct function name tabs_container_class() to ensure the
comment accurately directs readers to the proper symbol.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 93724309-405d-4a27-8a69-85d9d3e0842a
📒 Files selected for processing (14)
.gitignoredocs/TODO.mddocs/agents/tailwind-plus-rabbita.mdexamples/ideal/main/main.mbtexamples/ideal/main/model.mbtexamples/ideal/main/msg.mbtexamples/ideal/main/pkg.generated.mbtiexamples/ideal/main/ui/button.mbtexamples/ideal/main/ui/moon.pkgexamples/ideal/main/ui/pkg.generated.mbtiexamples/ideal/main/ui/tabs.mbtexamples/ideal/main/view_bottom.mbtexamples/ideal/main/view_bottom_classes.mbtexamples/ideal/web/styles/editor.css
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad912ab5f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ad912ab to
b06bb87
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b06bb8729d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b06bb87 to
a84fa14
Compare
Benchmark Comparison ReportComparing PR branch against Main Module BenchmarksBase branch: PR branch: event-graph-walker BenchmarksBase branch: PR branch: Benchmarks run with |
1b5eb8a to
bb36d15
Compare
Extract shared Ideal tab styling and headless rendering helpers into examples/ideal/main/ui/tabs.mbt. The Ideal app keeps selection in durable value state (mode and bottom_tab) and renders toolbar/bottom tabs from those values rather than storing Rabbita Cell or Emit handles in Model. - Move tab-specific toolbar and bottom-panel style recipes out of ui/button.mbt - Add TabStyle plus tablist_view/tab_trigger_view/tab_panel_view helpers - Keep toolbar Text/Structure controls as pressed buttons for existing semantics/tests - Render bottom-panel tabs through shared helpers and @tabs.Model behavior - Remove the temporary TabsDemo tab from the bottom panel
bb36d15 to
ff17b70
Compare
Summary
examples/ideal/main/ui/tabs.mbt.modeandbottom_tab); no RabbitaCellorEmithandles are stored inModel.role=button,aria-pressed) while sharing the tab-style recipe fromui/tabs.mbt.tablist_view/tab_trigger_viewhelpers and the existing@tabs.Modelkeyboard/ARIA behavior.Reuse check
Existing APIs considered:
@tabs.Modeldowdiness/rabbita-tabs/tabs@tabs.tablist_attrsdowdiness/rabbita-tabs/tabstablist_viewexamples/ideal/main/ui/button.mbttoolbar_tab_classso toolbar mode controls retain button semantics@rabbita.cell_with_emitrabbita/teaModelmust not store liveCell/Emithandles; tabs are derived from value state insteadNew helpers added:
TabStyle: container/trigger class recipes for value-derived tablists.tablist_view,tab_trigger_view,tab_panel_view: compositional headless rendering helpers.toolbar_tab_class,tab_class,tabs_container_class: Ideal-local style recipes for toolbar and bottom-panel tab chrome.Test plan
moon checkpassesmoon testpassesgit diff *.mbtireviewed for unintended API surface changesaria-pressedValidation