mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-28 19:14:53 +00:00
fix(app): show the Recent header in the inbox sidebar again (#66494)
Co-authored-by: Brendan <brendan@anoma.ly>
This commit is contained in:
parent
5ca42a3e0c
commit
80bd09332b
3 changed files with 9 additions and 16 deletions
|
|
@ -2402,7 +2402,7 @@ test("opening a session from the inbox keeps the list's scroll position and rows
|
|||
await expect(items).toHaveCount(10)
|
||||
await expect(items).toContainText(Array.from({ length: 10 }, (_, index) => `Inbox session ${23 - index}`))
|
||||
await expect(list.getByRole("group", { name: "Recent", exact: true })).toBeVisible()
|
||||
await expect(list.getByText("Recent", { exact: true })).toHaveCount(0)
|
||||
await expect(list.getByText("Recent", { exact: true })).toBeVisible()
|
||||
await list.evaluate((element) => element.scrollTo(0, element.scrollHeight))
|
||||
await expect(target).toBeInViewport({ ratio: 1 })
|
||||
// Git metadata must load for an unopened worktree, not only after selecting its session.
|
||||
|
|
|
|||
|
|
@ -148,7 +148,6 @@ function SessionListStory(props: {
|
|||
get label() {
|
||||
return language.t("sidebar.inbox.section.recent")
|
||||
},
|
||||
unlabeled: true,
|
||||
get count() {
|
||||
return visibleRecent().length
|
||||
},
|
||||
|
|
|
|||
|
|
@ -414,7 +414,6 @@ export function SidebarInbox() {
|
|||
get label() {
|
||||
return language.t("sidebar.inbox.section.recent")
|
||||
},
|
||||
unlabeled: true,
|
||||
get count() {
|
||||
return sections().recent.length
|
||||
},
|
||||
|
|
@ -566,8 +565,6 @@ export function InboxSessionList(props: {
|
|||
count: number
|
||||
rows: () => JSX.Element
|
||||
more?: () => JSX.Element
|
||||
/** Named for assistive tech only, without a visible header. */
|
||||
unlabeled?: boolean
|
||||
expanded?: boolean
|
||||
/** Collapsed, but its rows still render: the section passes only the selected session's row. */
|
||||
peek?: boolean
|
||||
|
|
@ -687,19 +684,16 @@ export function InboxSessionList(props: {
|
|||
<Show when={section.count > 0}>
|
||||
<div
|
||||
role="group"
|
||||
aria-label={section.unlabeled ? section.label : undefined}
|
||||
aria-labelledby={section.unlabeled ? undefined : `${id}-${section.id}`}
|
||||
aria-labelledby={`${id}-${section.id}`}
|
||||
class="flex shrink-0 flex-col gap-2 pb-2.5"
|
||||
>
|
||||
<Show when={!section.unlabeled}>
|
||||
<SectionHeader
|
||||
id={`${id}-${section.id}`}
|
||||
label={section.label}
|
||||
expanded={section.expanded}
|
||||
shimmer={section.shimmer}
|
||||
onToggle={section.onToggle}
|
||||
/>
|
||||
</Show>
|
||||
<SectionHeader
|
||||
id={`${id}-${section.id}`}
|
||||
label={section.label}
|
||||
expanded={section.expanded}
|
||||
shimmer={section.shimmer}
|
||||
onToggle={section.onToggle}
|
||||
/>
|
||||
<Show when={section.expanded !== false || section.peek}>
|
||||
<div class="flex flex-col gap-0.5">{section.rows()}</div>
|
||||
</Show>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue