Skip to content

docs: add layout component usage documentation#371

Open
SonyLeo wants to merge 2 commits into
opentiny:developfrom
SonyLeo:feat/layout-docs
Open

docs: add layout component usage documentation#371
SonyLeo wants to merge 2 commits into
opentiny:developfrom
SonyLeo:feat/layout-docs

Conversation

@SonyLeo

@SonyLeo SonyLeo commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Layout 组件文档预览地址如下:

Layout 组件 →

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added new Layout demos, including basic layout, floating mode, resizable and collapsible asides, aside modes, slot-driven customization, and main-area scrolling (via proxy scrollbar) examples.
  • Documentation

    • Added a comprehensive Layout component guide with Props, Slots, Events, and relevant CSS variables.
    • Updated the component navigation to include the “Layout 布局” entry.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a new Layout documentation page, a sidebar entry, and multiple Vue demos covering basic layout, aside behaviors, floating panels, and main scroll proxy scrolling.

Changes

Layout Documentation and Demos

Layer / File(s) Summary
Sidebar navigation entry
docs/.vitepress/themeConfig.ts
Adds Layout 布局 to the components sidebar.
Layout component documentation page
docs/src/components/layout.md
Creates the Layout docs page with usage, props, slots, events, types, and CSS variables.
Basic layout and aside behavior demos
docs/demos/layout/basic.vue, docs/demos/layout/aside-modes.vue, docs/demos/layout/aside-collapse-effect.vue, docs/demos/layout/aside-resizable.vue, docs/demos/layout/aside-slot-props.vue
Adds demos for the base layout, aside dock/drawer modes, collapse effects, resizable asides, and slot-driven aside state.
Floating mode demos
docs/demos/layout/floating.vue, docs/demos/layout/floating-panels.vue
Adds floating mode demos with reactive open state, draggable/resizable configuration, and drawer asides.
Main scroll proxy scrollbar demos
docs/demos/layout/main-scroll*.vue
Adds BubbleList and plain div main-scroll demos wired to TrLayout.ProxyScrollbar, plus a wrapper demo that switches between them.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • gene9831

Poem

🐇 A layout hops into the light,
Sidebars fold and float just right.
Scrollbars proxy, panels glide,
Tiny demos march side by side.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding Layout component documentation and related demos.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@SonyLeo SonyLeo changed the title feat(docs): add layout component usage documentation docs: add layout component usage documentation Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

✅ Preview build completed successfully!

Click the image above to preview.
Preview will be automatically removed when this PR is closed.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 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/demos/layout/aside-modes.vue`:
- Around line 4-15: The left/right aside open-change handlers are using the
broader LayoutAsideOpenDetail type even though the emitted payload is
LayoutAsideOpenValue. Update the imports and the
updateLeftAside/updateRightAside parameter types to use LayoutAsideOpenValue,
keeping the handlers focused on the { open } payload so the template type-check
matches the emit signatures.

In `@docs/demos/layout/aside-resizable.vue`:
- Around line 4-5: The `left-aside-resize` event payload is typed incorrectly in
`aside-resizable.vue`; `updateLeftAsideWidth` should use
`LayoutAsideResizeValue` because the event emits `{ expandedWidth }`, not
`LayoutAsideResizeDetail`. Update the import from `@opentiny/tiny-robot` and
change the `updateLeftAsideWidth` handler signature to match the actual
`@left-aside-resize` payload so the demo type matches the event data.

In `@docs/demos/layout/aside-slot-props.vue`:
- Around line 12-19: The left aside in the demo is being collapsed to zero
width, which prevents the rail UI from having any visible space when the aside
is closed. Update the `leftAside` computed in `aside-slot-props.vue` to either
use a non-zero `collapsedWidth` or stop rendering the closed-state rail branch
and rely on the external control only; keep the behavior consistent anywhere the
same pattern is repeated.
- Around line 4-5: The aside event handlers in the demo are typed with the
generic payload interfaces, but the emitted payloads for the side-specific
events do not include a side field. Update the callback typings in
aside-slot-props.vue and the other aside event bindings in this demo to use the
side-specific payload shapes for left/right-aside-open-change and
left/right-aside-resize, and keep LayoutAsideProps only where the full aside
props are actually needed.

In `@docs/demos/layout/floating-panels.vue`:
- Line 4: The `left-aside-open-change` and `right-aside-open-change` handlers
are typed with `LayoutAsideOpenDetail`, but those events emit an `{ open }`
payload, so update the relevant type usage in `floating-panels.vue` to
`LayoutAsideOpenValue` instead. Locate the handler typings and any related
references to `LayoutAsideOpenDetail` in the floating panels demo, and replace
them so the event payload type matches the emitted shape.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dc237448-4a35-4b26-8d3f-a3da5f984dcd

📥 Commits

Reviewing files that changed from the base of the PR and between 79556a0 and d4346b6.

📒 Files selected for processing (12)
  • docs/.vitepress/themeConfig.ts
  • docs/demos/layout/aside-collapse-effect.vue
  • docs/demos/layout/aside-modes.vue
  • docs/demos/layout/aside-resizable.vue
  • docs/demos/layout/aside-slot-props.vue
  • docs/demos/layout/basic.vue
  • docs/demos/layout/floating-panels.vue
  • docs/demos/layout/floating.vue
  • docs/demos/layout/main-scroll-bubble.vue
  • docs/demos/layout/main-scroll-div.vue
  • docs/demos/layout/main-scroll.vue
  • docs/src/components/layout.md

Comment thread docs/demos/layout/aside-modes.vue Outdated
Comment thread docs/demos/layout/aside-resizable.vue Outdated
Comment thread docs/demos/layout/aside-slot-props.vue Outdated
Comment thread docs/demos/layout/aside-slot-props.vue
Comment thread docs/demos/layout/floating-panels.vue Outdated
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