-
-
-
-
-
-
-
-
import type { Story, Variant } from '../../types'
-import { isMobile } from '../../util/responsive'
-import DevOnlyToolbarOpenInEditor from '../toolbar/DevOnlyToolbarOpenInEditor.vue'
-import ToolbarBackground from '../toolbar/ToolbarBackground.vue'
-import ToolbarNewTab from '../toolbar/ToolbarNewTab.vue'
-import ToolbarResponsiveSize from '../toolbar/ToolbarResponsiveSize.vue'
-import ToolbarTextDirection from '../toolbar/ToolbarTextDirection.vue'
-import ToolbarTitle from '../toolbar/ToolbarTitle.vue'
import StoryVariantSinglePreviewNative from './StoryVariantSinglePreviewNative.vue'
import StoryVariantSinglePreviewRemote from './StoryVariantSinglePreviewRemote.vue'
@@ -21,32 +14,6 @@ defineProps<{
class="histoire-story-variant-single-view htw-h-full htw-flex htw-flex-col"
data-test-id="story-variant-single-view"
>
-
-
-
-
-
-
-
-
-
-
-
-
import { Icon } from '@iconify/vue'
-import { ref, watch } from 'vue'
+import { computed, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
+import { useLayoutStore } from '../../stores/layout'
import { useStoryStore } from '../../stores/story'
import { isMobile } from '../../util/responsive'
@@ -12,6 +13,15 @@ import StorySidePanel from '../panel/StorySidePanel.vue'
import StoryViewer from './StoryViewer.vue'
const storyStore = useStoryStore()
+const layoutStore = useLayoutStore()
+
+const effectiveStoryOptionsVisible = computed(() =>
+ storyStore.currentStory?.meta?.storyOptions ?? layoutStore.settings.storyOptionsVisible,
+)
+
+const placement = computed(() => layoutStore.settings.storyOptionsPlacement)
+const splitOrientation = computed(() => placement.value === 'bottom' ? 'portrait' : 'landscape')
+const splitDefaultSplit = computed(() => placement.value === 'bottom' ? 60 : 75)
const router = useRouter()
const route = useRoute()
@@ -90,12 +100,17 @@ function scrollDocsToTop() {
+
+
+
diff --git a/packages/histoire-app/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue b/packages/histoire-app/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue
index a3f9e0ab..32f36013 100644
--- a/packages/histoire-app/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue
+++ b/packages/histoire-app/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue
@@ -1,6 +1,7 @@
-
-
+
diff --git a/packages/histoire-app/src/app/components/toolbar/ToolbarBackground.vue b/packages/histoire-app/src/app/components/toolbar/ToolbarBackground.vue
index 5f0d7f7c..c84455c6 100644
--- a/packages/histoire-app/src/app/components/toolbar/ToolbarBackground.vue
+++ b/packages/histoire-app/src/app/components/toolbar/ToolbarBackground.vue
@@ -1,14 +1,10 @@
@@ -16,21 +12,20 @@ const contrastColor = computed(() => getContrastColor(settings))
v-if="histoireConfig.backgroundPresets.length"
placement="bottom-end"
:skidding="6"
- class="histoire-toolbar-background htw-h-full htw-flex-none"
+ class="histoire-toolbar-background htw-flex-none"
data-test-id="toolbar-background"
>
diff --git a/packages/histoire-app/src/app/components/toolbar/ToolbarNewTab.vue b/packages/histoire-app/src/app/components/toolbar/ToolbarNewTab.vue
index aa9cddf2..4d4253d7 100644
--- a/packages/histoire-app/src/app/components/toolbar/ToolbarNewTab.vue
+++ b/packages/histoire-app/src/app/components/toolbar/ToolbarNewTab.vue
@@ -3,6 +3,7 @@ import type { Story, Variant } from '../../types'
import { Icon } from '@iconify/vue'
import { computed } from 'vue'
import { getSandboxUrl } from '../../util/sandbox'
+import TopBarChipItem from '../app/TopBarChipItem.vue'
const props = defineProps<{
variant: Variant
@@ -15,15 +16,15 @@ const sandboxUrl = computed(() => {
-
-
+
diff --git a/packages/histoire-app/src/app/components/toolbar/ToolbarResponsiveSize.vue b/packages/histoire-app/src/app/components/toolbar/ToolbarResponsiveSize.vue
index 42dd1082..0f93cdb3 100644
--- a/packages/histoire-app/src/app/components/toolbar/ToolbarResponsiveSize.vue
+++ b/packages/histoire-app/src/app/components/toolbar/ToolbarResponsiveSize.vue
@@ -13,22 +13,22 @@ const settings = usePreviewSettingsStore().currentSettings
placement="bottom-end"
:skidding="6"
:disabled="!histoireConfig.responsivePresets?.length"
- class="histoire-toolbar-responsive-size htw-h-full htw-flex-none"
+ class="histoire-toolbar-responsive-size htw-flex-none"
>
diff --git a/packages/histoire-app/src/app/components/toolbar/ToolbarTextDirection.vue b/packages/histoire-app/src/app/components/toolbar/ToolbarTextDirection.vue
index fe44e57b..753507ee 100644
--- a/packages/histoire-app/src/app/components/toolbar/ToolbarTextDirection.vue
+++ b/packages/histoire-app/src/app/components/toolbar/ToolbarTextDirection.vue
@@ -1,19 +1,20 @@
-
-
+
diff --git a/packages/histoire-app/src/app/components/toolbar/ToolbarTitle.vue b/packages/histoire-app/src/app/components/toolbar/ToolbarTitle.vue
index 263a616a..ad1f2dc5 100644
--- a/packages/histoire-app/src/app/components/toolbar/ToolbarTitle.vue
+++ b/packages/histoire-app/src/app/components/toolbar/ToolbarTitle.vue
@@ -1,21 +1,45 @@
-
+
+
+
diff --git a/packages/histoire-app/src/app/stores/layout.ts b/packages/histoire-app/src/app/stores/layout.ts
new file mode 100644
index 00000000..9e4a9728
--- /dev/null
+++ b/packages/histoire-app/src/app/stores/layout.ts
@@ -0,0 +1,22 @@
+import { useStorage } from '@vueuse/core'
+import { defineStore } from 'pinia'
+
+export type StoryOptionsPlacement = 'right' | 'bottom'
+
+export interface LayoutSettings {
+ storyListVisible: boolean
+ storyOptionsVisible: boolean
+ storyOptionsPlacement: StoryOptionsPlacement
+}
+
+export const useLayoutStore = defineStore('layout', () => {
+ const settings = useStorage
('_histoire-layout-v1', {
+ storyListVisible: true,
+ storyOptionsVisible: true,
+ storyOptionsPlacement: 'right',
+ })
+
+ return {
+ settings,
+ }
+})
diff --git a/packages/histoire-shared/src/types/story.ts b/packages/histoire-shared/src/types/story.ts
index 43622288..6871ca3d 100644
--- a/packages/histoire-shared/src/types/story.ts
+++ b/packages/histoire-shared/src/types/story.ts
@@ -43,7 +43,14 @@ export interface StoryProps extends CommonProps, InheritedProps {
export interface CommonMeta {}
-export interface StoryMeta extends CommonMeta {}
+export interface StoryMeta extends CommonMeta {
+ /**
+ * When set, overrides the global Story Options visibility for this story.
+ * `true` forces the right pane visible; `false` forces it hidden.
+ * `undefined` (default) defers to the global layout setting.
+ */
+ storyOptions?: boolean
+}
export interface Story {
id: string