mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 17:01:37 +03:00
feat(app): show a failed dot on tabs whose run failed (#62077)
This commit is contained in:
committed by
GitHub
Unverified
parent
d7d8581716
commit
d0045aaab5
@@ -654,6 +654,22 @@ test("icon-only inactive tabs retain their avatar and attention badge instead of
|
||||
await expect(tabB.locator('[data-slot="tab-avatar-unread-dot"]')).toHaveCount(0)
|
||||
})
|
||||
|
||||
test("an unread tab whose run failed shows the failed dot, as the inbox does", async ({ page }) => {
|
||||
const time = { created: T0, updated: T0, idle: T0 + 1 }
|
||||
|
||||
await mockWorkspace(page, {
|
||||
name: "FailedTabs",
|
||||
sessions: [a, { ...b, outcome: "failed", time }, { ...c, outcome: "succeeded", time }],
|
||||
})
|
||||
await page.goto(sessionHref(a.id))
|
||||
const tab = (id: string) => page.locator(`[data-titlebar-tab-slot]:has(a[href="${sessionHref(id)}"])`)
|
||||
|
||||
await expect(tab(b.id).locator('[data-mark="failed"]')).toBeVisible()
|
||||
await expect(tab(b.id).locator('[data-mark="unread"]')).toBeHidden()
|
||||
await expect(tab(c.id).locator('[data-mark="unread"]')).toBeVisible()
|
||||
await expect(tab(c.id).locator('[data-mark="failed"]')).toBeHidden()
|
||||
})
|
||||
|
||||
test("vertical tabs resize, scroll, show shortcut hints, and navigate", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1280, height: 480 })
|
||||
const directory = "C:/OpenCode/Tabs"
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
background: var(--v2-state-fg-warning);
|
||||
}
|
||||
|
||||
[data-titlebar-tab] :is([data-mark="failed"], [data-status="failed"] [data-slot="tab-avatar-unread-dot"]) {
|
||||
background: var(--v2-state-fg-danger);
|
||||
}
|
||||
|
||||
[data-titlebar-tab] [data-slot="tab-avatar-unread-dot"] {
|
||||
position: absolute;
|
||||
display: none;
|
||||
@@ -52,7 +56,8 @@
|
||||
|
||||
[data-titlebar-tab][data-status="busy"] [data-mark="busy"],
|
||||
[data-titlebar-tab][data-status="attention"] [data-mark="attention"],
|
||||
[data-titlebar-tab][data-status="unread"] [data-mark="unread"] {
|
||||
[data-titlebar-tab][data-status="unread"] [data-mark="unread"],
|
||||
[data-titlebar-tab][data-status="failed"] [data-mark="failed"] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -388,13 +393,17 @@
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
[data-titlebar-tab]:is([data-status="attention"], [data-status="unread"]):not([data-orientation="vertical"])
|
||||
[data-titlebar-tab]:is([data-status="attention"], [data-status="unread"], [data-status="failed"]):not(
|
||||
[data-orientation="vertical"]
|
||||
)
|
||||
[data-slot="project-avatar-surface"] {
|
||||
-webkit-mask-image: radial-gradient(circle 4.5px at 100% 0, transparent 4px, black 5px);
|
||||
mask-image: radial-gradient(circle 4.5px at 100% 0, transparent 4px, black 5px);
|
||||
}
|
||||
|
||||
[data-titlebar-tab]:is([data-status="attention"], [data-status="unread"]):not([data-orientation="vertical"]):dir(rtl)
|
||||
[data-titlebar-tab]:is([data-status="attention"], [data-status="unread"], [data-status="failed"]):not(
|
||||
[data-orientation="vertical"]
|
||||
):dir(rtl)
|
||||
[data-slot="project-avatar-surface"] {
|
||||
-webkit-mask-image: radial-gradient(circle 4.5px at 0 0, transparent 4px, black 5px);
|
||||
mask-image: radial-gradient(circle 4.5px at 0 0, transparent 4px, black 5px);
|
||||
|
||||
@@ -111,10 +111,13 @@ export function TabNavItem(
|
||||
|
||||
if (props.attention) return "attention"
|
||||
|
||||
if (props.unread) return "unread"
|
||||
if (!props.unread) return
|
||||
|
||||
// As in the inbox, an unread run that ended in failure gets the danger dot instead of the accent one.
|
||||
return props.session.outcome === "failed" ? "failed" : "unread"
|
||||
}
|
||||
|
||||
const dotted = () => status() === "attention" || status() === "unread"
|
||||
const dotted = () => status() === "attention" || status() === "unread" || status() === "failed"
|
||||
|
||||
const project = createMemo(() => {
|
||||
const session = props.session
|
||||
@@ -509,6 +512,7 @@ export function TabNavItem(
|
||||
<ActivityRing data-mark="busy" />
|
||||
<span data-mark="attention" data-slot="tab-status-dot" />
|
||||
<span data-mark="unread" data-slot="tab-status-dot" />
|
||||
<span data-mark="failed" data-slot="tab-status-dot" />
|
||||
</span>
|
||||
<IconButton
|
||||
size="small"
|
||||
|
||||
Reference in New Issue
Block a user