Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/widget/layout/BaseModalLayout.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface StoryArgs {
hasHeader: boolean
hasContentFilter: boolean
hasHeaderRightArea: boolean
headerPadding?: 'default' | 'symmetric'
cardCount: number
}

Expand All @@ -46,6 +47,11 @@ const meta: Meta<StoryArgs> = {
control: 'boolean',
description: 'Toggle header visibility'
},
headerPadding: {
control: 'select',
options: ['default', 'symmetric'],
description: 'Header bar spacing; symmetric matches the settings dialog'
},
hasContentFilter: {
control: 'boolean',
description: 'Toggle content filter visibility'
Expand Down Expand Up @@ -172,7 +178,7 @@ const createStoryTemplate = (args: StoryArgs) => ({
},
template: `
<div>
<BaseModalLayout v-if="!args.hasRightPanel" :content-title="args.contentTitle || 'Content Title'">
<BaseModalLayout v-if="!args.hasRightPanel" :content-title="args.contentTitle || 'Content Title'" :header-padding="args.headerPadding">
<!-- Left Panel Header Title -->
<template v-if="args.hasLeftPanel" #leftPanelHeaderTitle>
<i class="icon-[lucide--puzzle] size-4 text-neutral" />
Expand Down Expand Up @@ -294,7 +300,7 @@ const createStoryTemplate = (args: StoryArgs) => ({
</template>
</BaseModalLayout>

<BaseModalLayout v-else :content-title="args.contentTitle || 'Content Title'">
<BaseModalLayout v-else :content-title="args.contentTitle || 'Content Title'" :header-padding="args.headerPadding">
<!-- Same content but WITH right panel -->
<!-- Left Panel Header Title -->
<template v-if="args.hasLeftPanel" #leftPanelHeaderTitle>
Expand Down Expand Up @@ -421,6 +427,7 @@ const createStoryTemplate = (args: StoryArgs) => ({
export const Default: Story = {
render: (args: StoryArgs) => createStoryTemplate(args),
args: {
headerPadding: 'default',
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
contentTitle: 'Content Title',
hasLeftPanel: true,
hasRightPanel: true,
Expand Down
24 changes: 19 additions & 5 deletions src/components/widget/layout/BaseModalLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@
</nav>

<div class="flex flex-col overflow-hidden bg-base-background">
<header
v-if="$slots.header"
class="flex h-18 w-full items-center justify-between gap-2 px-6"
>
<div class="flex min-w-0 flex-1 gap-2">
<header v-if="$slots.header" :class="headerClass">
<div :class="headerContentClass">
<Button
v-if="!notMobile && !showLeftPanel"
size="lg"
Expand Down Expand Up @@ -155,20 +152,23 @@ const SIZE_CLASSES = {

type ModalSize = keyof typeof SIZE_CLASSES
type ContentPadding = 'default' | 'compact' | 'none'
type HeaderPadding = 'default' | 'symmetric'

const {
contentTitle,
rightPanelTitle,
size = 'lg',
leftPanelWidth = '14rem',
contentPadding = 'default',
headerPadding = 'default',
closeButtonVariant
} = defineProps<{
contentTitle: string
rightPanelTitle?: string
size?: ModalSize
leftPanelWidth?: string
contentPadding?: ContentPadding
headerPadding?: HeaderPadding

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.

🟢 Low — The new headerPadding prop has no caller outside this component and its stories — SettingDialog.vue, the dialog the story description names as the motivation for symmetric, still renders BaseModalLayout without it. The new branch therefore ships exercised only in Storybook; wire up the intended consumer here or confirm the follow-up that will. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional: the consumer is #18319, which is stacked on this PR. SettingDialog opts into header-padding="symmetric" there. This PR ships only the additive seam (default path byte-identical to today) so it can be reviewed on its own.

closeButtonVariant?: ButtonVariants['variant']
}>()

Expand Down Expand Up @@ -205,6 +205,20 @@ const showLeftPanel = computed(() => {
return shouldShow
})

const headerClass = computed(() =>
cn(
'flex w-full items-center justify-between gap-2',
headerPadding === 'symmetric' ? 'px-6 py-5' : 'h-18 px-6'
)
)

const headerContentClass = computed(() =>
cn(
'flex min-w-0 flex-1 gap-2',
headerPadding === 'symmetric' && 'min-h-10 items-center'
)
)

const contentContainerClass = computed(() =>
cn(
'flex scrollbar-custom min-h-0 flex-1 flex-col overflow-y-auto',
Expand Down
Loading