Skip to content

Improve website examples and documentation navigation - #21

Merged
hyfdev merged 3 commits into
mainfrom
agent/getting-started-code-result
Aug 16, 2026
Merged

hyfdev merged 3 commits into
mainfrom
agent/getting-started-code-result

Conversation

@hyfdev

@hyfdev hyfdev commented Aug 16, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • Show the Getting Started WebAssembly example as a two-column code and result pair.
  • Display the exact read-only source file that each browser example imports and executes.
  • Add focused homepage controls for available width, sidebar width, header height, and horizontal and vertical gaps.
  • Keep code and controls side by side on desktop and stacked on narrow screens.
  • Put Guide, Essentials, @taffyjs/node, and @taffyjs/wasm in one shared documentation sidebar and remove the separate Packages menu.
  • Record the examples and documentation navigation in the website rules.

Why

The examples now make the connection between JavaScript inputs and computed rectangles easier to see without introducing an editor or a general-purpose playground. The documentation structure is also visible from every documentation page instead of being split between the top navigation and separate sidebars.

Checks

  • vp run ready
  • vp run check:wasm
  • Browser checks at 1440px and 390px, including all control ranges, keyboard slider input, dark mode, page overflow, failed module loading, and documentation navigation
  • Two independent adversarial reviews

@hyfdev hyfdev changed the title Show code beside the Getting Started demo Improve interactive layout examples Aug 16, 2026
@hyfdev hyfdev changed the title Improve interactive layout examples Improve website examples and documentation navigation Aug 16, 2026
@hyfdev
hyfdev marked this pull request as ready for review August 16, 2026 09:48
Copilot AI lite review requested due to automatic review settings August 16, 2026 09:49
@hyfdev
hyfdev merged commit f5e0407 into main Aug 16, 2026
6 checks passed

Copilot AI 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.

Pull request overview

This PR refines the VitePress website experience by making interactive examples more transparent (showing the exact source being executed) and by consolidating documentation navigation into a single, always-visible sidebar across Guide and package docs.

Changes:

  • Reworks the Getting Started in-browser Wasm example into a two-column “code + result” layout that imports and runs the displayed source file.
  • Expands the homepage layout demo with additional focused controls (sidebar width, header height, horizontal/vertical gap) while keeping a compact code-to-rectangles presentation.
  • Consolidates documentation navigation so Guide, Essentials, and package docs share one sidebar (and removes the separate Packages top-nav menu).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/website/guide/getting-started.md Embeds the browser demo as a code+result pair and includes the exact executed example source.
apps/website/examples/getting-started-width.js Adds the browser-executed layout computation source used by the Getting Started demo.
apps/website/.vitepress/components/LayoutWidthDemo.vue Updates the demo component to import and run the shared example source and render code+result side by side.
apps/website/examples/home-layout.js Updates the homepage layout computation to accept multiple controllable inputs.
apps/website/.vitepress/components/HomeLayoutShowcase.vue Adds the new homepage controls and passes them into computeHomeLayout.
apps/website/.vitepress/config.ts Replaces split navigation with a single shared documentation sidebar for Guide/Node/Wasm.
.agents/docs/website.md Records updated website rules for examples and unified documentation navigation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +10 to +14
const tree = new TaffyTree();

const sidebar = tree.newLeaf({ size: { width: 88 } });
const header = tree.newLeaf({ size: { height: 40 } });
const content = tree.newLeaf({ flexGrow: 1 });
const sidebar = tree.newLeaf({ size: { width: sidebarWidth } });
const header = tree.newLeaf({ size: { height: headerHeight } });
const content = tree.newLeaf({ flexGrow: 1 });
Comment on lines +35 to +37
<div class="layout-demo-code" aria-label="Read-only TaffyJS example code">
<slot />
</div>
Comment on lines 84 to 86
<div class="home-layout-code" aria-label="TaffyJS example code">
<slot />
</div>
hyfdev added a commit that referenced this pull request Aug 16, 2026
Add the public website, package documentation, guides, and usage examples.

Refs: #5, #18, #21
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