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
19 changes: 13 additions & 6 deletions packages/app/e2e/regression/review.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 7 additions & 3 deletions packages/app/src/runtime/extension/side-region.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/gui-extensions/src/file/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
6 changes: 6 additions & 0 deletions packages/gui-extensions/src/file/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 5 additions & 22 deletions packages/ui/src/navigation/tabs/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Loading