fix(app): fix side panel tab clipping and alignment (#53315)

This commit is contained in:
Luke Parker
2026-10-06 08:46:47 +10:00
committed by GitHub
Unverified
parent b9db2f6915
commit d1e6104087
5 changed files with 32 additions and 32 deletions
+13 -6
View File
@@ -890,13 +890,20 @@ for (const direction of ["ltr", "rtl"] as const) {
)
})
.toBe(true)
await expect
.poll(async () => {
const box = await panel.locator('[data-slot="session-side-panel-actions"]').boundingBox()
return box ? box.y + box.height / 2 : undefined
})
.toBe(closed.y + closed.height / 2)
for (const control of [
panel.locator('[data-slot="session-side-panel-actions"]'),
panel.getByRole("button", { name: "Open file", exact: true }),
]) {
await expect
.poll(async () => {
const box = await control.boundingBox()
return box ? box.y + box.height / 2 : undefined
})
.toBe(closed.y + closed.height / 2)
}
await toggle.press("Enter")
await expect(toggle).toHaveAttribute("aria-expanded", "false")
await expect(toggle).toBeFocused()
@@ -146,7 +146,12 @@ export function SideRegion(props: {
props.region.select(value)
}}
>
<div class="session-review-v2-tabs-bar sticky top-0 shrink-0 flex items-center">
{/* Tabs and actions share the review toggle's row: the session header's 48px, or the 51px
above a side dock's divider. */}
<div
class="session-review-v2-tabs-bar sticky top-0 shrink-0 flex items-center"
style={{ "--tabs-bar-height": props.stacked ? "51px" : "48px" }}
>
<Tabs.List
ref={(el: HTMLDivElement) => {
tabList = el
@@ -189,8 +194,7 @@ export function SideRegion(props: {
</Tabs.List>
<div
data-slot="session-side-panel-actions"
class="session-review-v2-open-in-app-slot self-start shrink-0 flex items-center gap-2 pe-3"
classList={{ "h-[51px]": props.stacked, "h-12": !props.stacked }}
class="session-review-v2-open-in-app-slot h-[var(--tabs-bar-height)] shrink-0 flex items-center gap-2 pe-3"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => event.stopPropagation()}
>
+1 -1
View File
@@ -5,7 +5,7 @@ import { getFilename } from "@opencode/util/path"
/** A file tab's trigger content. The selected tab's icon colour comes from the tab CSS. */
export function FileVisual(props: { path: string; temporary?: boolean; notFound?: boolean }): JSX.Element {
return (
<div class="flex items-center gap-x-1.5 min-w-0">
<div class="flex items-center gap-x-2 min-w-0">
<span class="relative inline-flex size-4 shrink-0">
<FileIcon node={{ path: props.path, type: "file" }} class="absolute inset-0 size-4 tab-fileicon-color" />
<FileIcon node={{ path: props.path, type: "file" }} mono class="absolute inset-0 size-4 tab-fileicon-mono" />
@@ -5,6 +5,12 @@
padding-inline-end: 4px;
}
/* The pill's padding sets the file icon's inset; the trigger clips anything pulled past its edge. */
:root body #review-panel [data-component="tabs"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-list"] [data-slot="tabs-trigger-wrapper"][data-value^="file://"]
{
padding-inline-start: 8px;
}
:root body #review-panel [data-component="tabs"][data-variant="normal"][data-orientation="horizontal"] [data-slot="tabs-list"] [data-slot="tabs-trigger-wrapper"]:is([data-value="file:open"], [data-value^="file://"]) [data-slot="tabs-trigger-close-button"]
{
margin-inline-start: 0;
+5 -22
View File
@@ -568,11 +568,6 @@
color: var(--v2-text-text-base);
}
.tab-fileicon-color,
.tab-fileicon-mono {
margin-inline-start: -2px;
}
.italic {
font-style: italic !important;
font-variation-settings: "slnt" -10 !important;
@@ -600,27 +595,15 @@
flex: 1 1 0;
min-width: 0;
width: auto;
height: var(--tabs-bar-height);
padding-inline-end: 0;
border-bottom: none;
}
/* The end gap lives inside the sticky "+" box. Sticky offsets respect the strip's padding, so padding there
would leave a gap after the "+" where scrolled tabs show through. */
:root body #review-panel [data-component="tabs"] .session-review-v2-tabs-bar [data-slot="tabs-list"] > .sticky {
padding-inline-end: 0;
[data-component="icon-button-v2"] {
position: relative;
&::after {
content: "";
position: absolute;
inset-inline-start: 100%;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 28px;
background-color: var(--v2-background-bg-base);
pointer-events: none;
}
}
padding-inline-end: 12px;
}
:root