mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(app): match the sidebar peek's end inset to its start inset (#64192)
This commit is contained in:
committed by
GitHub
Unverified
parent
f4107529f6
commit
9b57cc05cb
@@ -125,7 +125,8 @@ export default function Layout(props: ParentProps) {
|
||||
paintSidebarContents()
|
||||
paintCollapsedSlots(closed)
|
||||
},
|
||||
measure: () => measureSidebarToggles(state.tabsWidth * sidebarHidden()),
|
||||
// The contents slide by their own width, which a peek widens past the docked sidebar's.
|
||||
measure: () => measureSidebarToggles((state.tabsMount?.offsetWidth ?? state.tabsWidth) * sidebarHidden()),
|
||||
// A dock from a peek already shows the sidebar, so reduced motion has nothing to fade in.
|
||||
element: () => (peek.handedOff() ? undefined : state.tabsPanel),
|
||||
distance: () => state.tabsWidth,
|
||||
@@ -248,7 +249,11 @@ export default function Layout(props: ParentProps) {
|
||||
data-slot="vertical-tabs-sidebar"
|
||||
data-state={preferences.appearance.sidebarOpen() ? "open" : "closed"}
|
||||
data-peek={peek.shown() ? "" : undefined}
|
||||
style={{ "--sidebar-peek-width": `${state.tabsWidth}px` }}
|
||||
style={{
|
||||
"--sidebar-peek-width": peek.shown()
|
||||
? `calc(${state.tabsWidth}px + var(--shell-inline-inset, 8px))`
|
||||
: `${state.tabsWidth}px`,
|
||||
}}
|
||||
ref={(element) => setState("tabsAside", element)}
|
||||
class="relative z-10 h-full min-h-0 shrink-0"
|
||||
>
|
||||
@@ -270,14 +275,14 @@ export default function Layout(props: ParentProps) {
|
||||
data-slot="vertical-tabs-peek-surface"
|
||||
aria-hidden="true"
|
||||
class="pointer-events-none absolute inset-y-0 end-0 bg-v2-background-bg-deep shadow-[var(--v2-elevation-floating)]"
|
||||
style={{ width: `${state.tabsWidth}px` }}
|
||||
style={{ width: "var(--sidebar-peek-width)" }}
|
||||
/>
|
||||
<div
|
||||
ref={(element) => setState("tabsMount", element)}
|
||||
data-slot="vertical-tabs-mount"
|
||||
class="absolute inset-y-0 end-0 contain-strict [overflow-clip-margin:var(--sidebar-divider-bleed,0px)] will-change-[opacity] flex min-h-0 flex-col bg-v2-background-bg-deep ps-[var(--sidebar-inset-start)] pe-[var(--sidebar-inset-end)] pb-[var(--shell-bottom-inset,8px)] pt-[var(--shell-top-inset,8px)]"
|
||||
style={{
|
||||
width: `${state.tabsWidth}px`,
|
||||
width: "var(--sidebar-peek-width)",
|
||||
"padding-bottom": "max(10px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))",
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* A peek also covers the docked sidebar's gap before the content, as end inset, so its contents sit where they do
|
||||
docked. */
|
||||
[data-slot="vertical-tabs-sidebar"][data-peek] [data-slot="vertical-tabs-mount"] {
|
||||
padding-inline-end: calc(var(--sidebar-inset-end) + var(--shell-inline-inset, 8px));
|
||||
}
|
||||
|
||||
/* The collapsed toggle is the one in reach while the sidebar peeks; the docked one's spot stays empty. */
|
||||
[data-slot="vertical-tabs-sidebar"][data-peek] [data-slot="sidebar-header"] > :last-child {
|
||||
visibility: hidden;
|
||||
|
||||
Reference in New Issue
Block a user