Skip to content

feat(app): customize layout modal, iOS-style topbar, per-story storyOptions (closes #620, #558)#833

Open
50rayn wants to merge 10 commits intohistoire-dev:mainfrom
50rayn:feat/layout-customization
Open

feat(app): customize layout modal, iOS-style topbar, per-story storyOptions (closes #620, #558)#833
50rayn wants to merge 10 commits intohistoire-dev:mainfrom
50rayn:feat/layout-customization

Conversation

@50rayn
Copy link
Copy Markdown
Contributor

@50rayn 50rayn commented Apr 30, 2026

What

  • Customize Layout modal — toggle Story List, Story Options visibility, and Story Options placement (right ↔ bottom). Settings persist in localStorage. Open via header icon or meta+shift+l / ctrl+shift+l; close via backdrop, Esc, or ×.
  • Per-story meta.storyOptions override — docs-heavy stories can hide the options pane while the rest keep it. Story-level value always wins over the global setting. Closes New story option : disable the right side panel #558.
  • iOS-style glossy top bar — three frosted-glass chips (gradient + backdrop-blur + soft border + shadow). Left: app actions (Layout / Search / Dark mode). Center: fixed-height title block (variant title + parent story name, no layout jump between 1- and 2-row states). Right: variant toolbar (Responsive / Background / Text dir / New Tab / Open in editor).
  • Story Options panel renders as a card (rounded border, slight margin, lighter bg) when placement is `right`.
  • On mobile the Layout button is hidden — no panes to configure there, Search + Dark Mode chip stays in the header.

Inspired by VSCode's Customize Layout panel (reference screenshot in #620).

Why

Closes #620 — layout customization was the most-requested ergonomic improvement: reviewers want Story List out of the way, docs authors want the options pane gone, side-by-side vs. bottom placement is a constant trade-off depending on screen width.

Closes #558 — the per-story override means you don't have to choose one global layout for mixed doc/component story files.

Screenshots

demo

Test plan

A new Cypress suite covers the main flows — `examples/vue3/cypress/e2e/layout.cy.js`, 8 specs:

  • Open modal via header icon
  • Open / close modal via `meta+shift+l` / `ctrl+shift+l`
  • Close via backdrop click and Esc
  • Toggle Story List visibility → panel hides/shows
  • Toggle Story Options visibility → panel hides/shows
  • Switch placement right ↔ bottom → panel repositions
  • Settings survive page reload (localStorage round-trip)
  • `meta.storyOptions: false` hides pane on that story, sibling stories unaffected

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit 5094084
🔍 Latest deploy log https://app.netlify.com/projects/histoire-examples-svelte3/deploys/69f39e6f5435540008dffe50
😎 Deploy Preview https://deploy-preview-833--histoire-examples-svelte3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit 5094084
🔍 Latest deploy log https://app.netlify.com/projects/histoire-examples-vue3/deploys/69f39e6f5435540008dffe4b
😎 Deploy Preview https://deploy-preview-833--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit 5094084
🔍 Latest deploy log https://app.netlify.com/projects/histoire-site/deploys/69f39e6f5435540008dffe47
😎 Deploy Preview https://deploy-preview-833--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2026

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit 5094084
🔍 Latest deploy log https://app.netlify.com/projects/histoire-controls/deploys/69f39e6fc8a12c0008d7903a
😎 Deploy Preview https://deploy-preview-833--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 30, 2026

Open in StackBlitz

histoire

npm i https://pkg.pr.new/histoire@833

@histoire/app

npm i https://pkg.pr.new/@histoire/app@833

@histoire/controls

npm i https://pkg.pr.new/@histoire/controls@833

@histoire/plugin-nuxt

npm i https://pkg.pr.new/@histoire/plugin-nuxt@833

@histoire/plugin-percy

npm i https://pkg.pr.new/@histoire/plugin-percy@833

@histoire/plugin-screenshot

npm i https://pkg.pr.new/@histoire/plugin-screenshot@833

@histoire/plugin-svelte

npm i https://pkg.pr.new/@histoire/plugin-svelte@833

@histoire/plugin-vue

npm i https://pkg.pr.new/@histoire/plugin-vue@833

@histoire/shared

npm i https://pkg.pr.new/@histoire/shared@833

@histoire/vendors

npm i https://pkg.pr.new/@histoire/vendors@833

commit: 5094084

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive layout customization features, allowing users to toggle the visibility of the story list and story options, and adjust the placement of story options (right or bottom). This includes new components for layout settings, a dedicated layout modal, and corresponding Cypress tests to ensure functionality and persistence across reloads. Toolbar elements for search, dark mode, and story actions have been refactored and moved into new AppActions and TopBar components for better organization and responsiveness. Additionally, a storyOptions meta property was added to allow per-story overrides of the global story options visibility. Review comments highlight a bug where the dark mode keyboard shortcut becomes inactive when the story list is hidden, a typo in a base list item class name, and unused code in the ToolbarBackground component.

Comment on lines +83 to +86
onKeyboardShortcut(['ctrl+shift+l', 'meta+shift+l'], (event) => {
isLayoutOpen.value = !isLayoutOpen.value
event.preventDefault()
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The dark mode keyboard shortcut (ctrl+shift+d / meta+shift+d) is currently registered in AppHeader.vue. However, with the new layout customization, AppHeader is not rendered when the story list is hidden on desktop (see the v-else block at line 172). This causes the shortcut to stop working when the story list is toggled off.

Please move the dark mode shortcut registration to App.vue alongside the search and layout shortcuts to ensure it remains active globally. You will also need to import toggleDark from ./util/dark.

<template>
<a
class="istoire-base-list-ite htw-flex htw-items-center htw-gap-2 htw-text-gray-900 dark:htw-text-gray-100"
class="histoire-base-list-ite htw-flex htw-items-center htw-gap-2 htw-text-gray-900 dark:htw-text-gray-100"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo in the class name histoire-base-list-ite. It should be histoire-base-list-item to match the component name and standard naming conventions.

    class="histoire-base-list-item htw-flex htw-items-center htw-gap-2 htw-text-gray-900 dark:htw-text-gray-100"

placement="bottom-end"
:skidding="6"
class="histoire-toolbar-background htw-h-full htw-flex-none"
class="histoire-toolbar-background htw-flex-none"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The contrastColor computed property (defined at line 16) appears to be unused now that the preview circle has been removed from the template. Consider removing it and the getContrastColor import to clean up dead code.

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