Repository navigation
chore(editor): reorganize (dev)/ui showcase with sidebar nav - #750
Conversation
- Add shared sidebar (_nav.ts, _sidebar.tsx, layout.tsx) for /ui dev pages - Move tree-view showcase into the @grida/tree-view packages page - Refresh floating-window, frames, and tree-view fixtures/patterns
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a typed dev UI navigation and persistent sidebar, splits the monolithic tree-view demo into reusable pattern panels and SVG-editor-backed showcases, simplifies the dev UI index, updates the tree-view landing page and frames demo, and modernizes floating-window primitives to use element-based boundary/measurement APIs. ChangesUI Workbench and Demo Infrastructure
Floating Window API Modernization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cd7050e33
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
editor/components/floating-window/primitives.tsx (1)
650-693: 💤 Low valuePolling approach is sound but consider a bail-out limit.
The rAF polling continues indefinitely until
ref.currentresolves. In edge cases where the ref is never populated (misconfiguration, conditional unmounting), this silently polls forever. A maximum iteration limit with a dev-mode warning would surface these issues earlier.That said, the cleanup is correct and the intended use-case (brief mount timing gap) should resolve within a few frames — this is a minor defensive hardening suggestion.
🤖 Prompt for 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. In `@editor/components/floating-window/primitives.tsx` around lines 650 - 693, useResolvedBoundaryEl currently rAF-polls indefinitely via poll/requestAnimationFrame until ref.current resolves; add a max-attempts bail-out to avoid endless polling: introduce a counter (e.g. attempts) and a constant MAX_ATTEMPTS, increment attempts each tick in poll, and if attempts >= MAX_ATTEMPTS cancel the rAF, set rafId = null, and setResolved(null) (or leave as-is) and in development emit a console.warn mentioning useResolvedBoundaryEl/ref boundary not resolving; ensure cleanup still cancels rafId as before and reference symbols poll, rafId, requestAnimationFrame, and useResolvedBoundaryEl when making the change.
🤖 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 `@editor/app/`(dev)/ui/components/tree-view/_patterns.tsx:
- Around line 229-245: The chevron button is still rendered for leaf rows
(row.isContainer === false) but marked aria-hidden, creating an invalid
focusable control; change the JSX to only render the interactive <button> when
row.isContainer is true (so the onClick and controller.toggle(row.id) logic
stays inside that branch) and for non-containers render either nothing or a
non-focusable element (e.g., a <span> or null) instead of a button; ensure
ChevronDownIcon/ChevronRightIcon remain inside the conditional so only
containers create a focusable control and remove aria-hidden from any remaining
focusable element.
In `@editor/app/`(dev)/ui/components/tree-view/_showcase.tsx:
- Around line 377-393: The chevron button is still mounted for leaf rows
(row.isContainer === false) which creates hidden-but-focusable controls; change
the rendering so that only container rows render an interactive <button> with
the onClick that calls controller.toggle(row.id) and appropriate aria
attributes, and render a non-interactive element (e.g., a <span> or <div>) with
the same visual classes (tone.chevronContainer / tone.chevron(selected)) for
leaf rows so it is not focusable or tabbable; keep the same icons
(ChevronDownIcon / ChevronRightIcon) but only inside the button when
row.isContainer.
---
Nitpick comments:
In `@editor/components/floating-window/primitives.tsx`:
- Around line 650-693: useResolvedBoundaryEl currently rAF-polls indefinitely
via poll/requestAnimationFrame until ref.current resolves; add a max-attempts
bail-out to avoid endless polling: introduce a counter (e.g. attempts) and a
constant MAX_ATTEMPTS, increment attempts each tick in poll, and if attempts >=
MAX_ATTEMPTS cancel the rAF, set rafId = null, and setResolved(null) (or leave
as-is) and in development emit a console.warn mentioning
useResolvedBoundaryEl/ref boundary not resolving; ensure cleanup still cancels
rafId as before and reference symbols poll, rafId, requestAnimationFrame, and
useResolvedBoundaryEl when making the change.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 336f8be7-f599-47b5-991a-8b4139ceb6cc
📒 Files selected for processing (13)
editor/app/(dev)/ui/_nav.tseditor/app/(dev)/ui/_sidebar.tsxeditor/app/(dev)/ui/components/layout.tsxeditor/app/(dev)/ui/components/tree-view/_fixtures.tseditor/app/(dev)/ui/components/tree-view/_patterns.tsxeditor/app/(dev)/ui/components/tree-view/_showcase.tsxeditor/app/(dev)/ui/components/tree-view/page.tsxeditor/app/(dev)/ui/floating-window/page.tsxeditor/app/(dev)/ui/frames/page.tsxeditor/app/(dev)/ui/layout.tsxeditor/app/(dev)/ui/page.tsxeditor/app/(tools)/(packages)/packages/[%40grida]/tree-view/page.tsxeditor/components/floating-window/primitives.tsx
💤 Files with no reviewable changes (3)
- editor/app/(dev)/ui/components/layout.tsx
- editor/app/(dev)/ui/components/tree-view/page.tsx
- editor/app/(dev)/ui/components/tree-view/_fixtures.ts
- Restore default 100% w/h on FloatingWindowBounds (via cn merge, so caller className still overrides) — fixes playground.tsx mounting with no sizing props. - Tree-view chevron a11y: only container rows render an interactive button (with aria-label); leaf rows render a non-focusable span, removing the invalid aria-hidden focusable control.
Summary
_nav.ts,_sidebar.tsx,layout.tsx) across the(dev)/uishowcase pages@grida/tree-viewpackages page; drop the standalonecomponents/tree-view/page.tsxand the oldcomponents/layout.tsxNo behavioral changes outside of the dev-only
(dev)/uiroutes.Test plan
pnpm turbo dev --filter=editor→ visit/uiand confirm the sidebar groups (Components / Packages / Forms / Showcases) render and links route correctly/packages/@grida/tree-viewshows the migrated tree-view showcase/ui/floating-windowand/ui/framesstill render as expectedSummary by CodeRabbit
New Features
Refactor
Chore