mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
fix(tui): show completed session tabs in success green
This commit is contained in:
parent
3a69bae845
commit
21db82741f
2 changed files with 17 additions and 3 deletions
|
|
@ -564,7 +564,7 @@ function VerticalSessionTabs(props: {
|
|||
const compact = createMemo(() => width() < SESSION_TABS_COMPACT_BREAKPOINT)
|
||||
const tooltipWidth = () => Math.min(54, dimensions().width - width())
|
||||
const stride = () => (compact() ? 2 : 3)
|
||||
const unreadColor = () => theme.hue.accent[200]
|
||||
const unreadColor = () => theme.text.feedback.success.base
|
||||
const activeNumber = () => theme.hue.interactive[200]
|
||||
const idleNumber = () => tint(theme.text.formfield.base, background(), 0.55)
|
||||
const separatorUpperPulseColor = createMemo(() => tint(background(), theme.text.base, 0.04))
|
||||
|
|
@ -1327,7 +1327,7 @@ function HorizontalSessionTabs(props: {
|
|||
onCleanup(clearCloseHold)
|
||||
// A captured drag ends with a synthetic up on its drop target; do not turn that into a click.
|
||||
let suppressClick = false
|
||||
const unreadColor = () => theme.hue.accent[200]
|
||||
const unreadColor = () => theme.text.feedback.success.base
|
||||
const activeNumber = () => theme.hue.interactive[200]
|
||||
const idleNumber = () => tint(theme.text.formfield.base, theme.background.base, 0.55)
|
||||
const newTab = () => tabs.newTab?.() ?? false
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ for (const orientation of ["horizontal", "vertical"] as const) {
|
|||
.lines.flatMap((line) => line.spans)
|
||||
.find((span) => span.text.trim() === glyph)?.fg
|
||||
expect(color?.toInts()).toEqual(
|
||||
(unread === "error" ? theme.text.feedback.error.base : theme.hue.accent[200]).toInts(),
|
||||
(unread === "error" ? theme.text.feedback.error.base : theme.text.feedback.success.base).toInts(),
|
||||
)
|
||||
await app.mockMouse.click(1, orientation === "vertical" ? 1 : 0)
|
||||
await app.renderOnce()
|
||||
|
|
@ -203,6 +203,20 @@ for (const orientation of ["horizontal", "vertical"] as const) {
|
|||
draft.tabs.indicators = "numbers"
|
||||
})
|
||||
await app.waitForFrame((frame) => frame.includes("1 First") && frame.includes("2 Second"))
|
||||
setActive("second")
|
||||
for (const state of [
|
||||
{ status: { unread: "activity" }, color: theme.text.feedback.success.base },
|
||||
{ status: { busy: true, attention: "permission" }, color: theme.hue.accent[200] },
|
||||
] as const) {
|
||||
setStatus({ ...EMPTY_SESSION_TAB_STATUS, ...state.status })
|
||||
await app.renderOnce()
|
||||
const number = app
|
||||
.captureSpans()
|
||||
.lines.flatMap((line) => line.spans)
|
||||
.find((span) => span.text.trim() === "1")?.fg
|
||||
expect(number?.toInts()).toEqual(state.color.toInts())
|
||||
}
|
||||
setStatus({ ...EMPTY_SESSION_TAB_STATUS, busy: true })
|
||||
await config.update((draft) => {
|
||||
draft.tabs.indicators = "status"
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue