fix(story): add buttons to container, not to the document#750
Conversation
Adding the buttons to the document persisted them when displaying another story. This was incorrectly done in the HtmlLabel and ScrollBars stories. Also improve the rendering of the buttons in these stories, and display a description of what they demonstrate.
WalkthroughThis pull request refactors two Storybook example files by updating their import statements and restructuring the Template functions. In both Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant T as Template Function
participant MDR as createMainDiv()
participant C as GraphContainer
participant BD as ButtonDiv
U->>T: Call Template()
T->>MDR: Create main div with descriptive text
MDR-->>T: Return mainDiv
T->>C: Append mainDiv to container
T->>BD: Create button container div
T->>BD: Append styled buttons (Undo/Redo or Zoom In/Out)
T->>mainDiv: Append button container to mainDiv
T-->>U: Return mainDiv
Possibly related PRs
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Definitions (1)packages/html/stories/HtmlLabel.stories.js (1)
🔇 Additional comments (10)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|



Adding the buttons to the document persisted them when displaying another story.
This was incorrectly done in the HtmlLabel and ScrollBars stories.
Also improve the rendering of the buttons in these stories, and display a description of what they demonstrate.
Summary by CodeRabbit