Skip to content

Commit bc37072

Browse files
albingroenRyan Wyler
authored andcommitted
feat(app): highlight collapsed active project in sidebar (anomalyco#6958)
1 parent a07bf39 commit bc37072

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/app/src/pages/layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,10 @@ export default function Layout(props: ParentProps) {
759759
const isExpanded = createMemo(() =>
760760
props.mobile ? mobileProjects.expanded(props.project.worktree) : props.project.expanded,
761761
)
762+
const isActive = createMemo(() => {
763+
const current = params.dir ? base64Decode(params.dir) : ""
764+
return props.project.worktree === current || props.project.sandboxes?.includes(current)
765+
})
762766
const handleOpenChange = (open: boolean) => {
763767
if (props.mobile) {
764768
if (open) mobileProjects.expand(props.project.worktree)
@@ -777,7 +781,10 @@ export default function Layout(props: ParentProps) {
777781
<Button
778782
as={"div"}
779783
variant="ghost"
780-
class="group/session flex items-center justify-between gap-3 w-full px-1.5 self-stretch h-auto border-none rounded-lg"
784+
classList={{
785+
"group/session flex items-center justify-between gap-3 w-full px-1.5 self-stretch h-auto border-none rounded-lg": true,
786+
"bg-surface-raised-base-hover": isActive() && !isExpanded(),
787+
}}
781788
>
782789
<Collapsible.Trigger class="group/trigger flex items-center gap-3 p-0 text-left min-w-0 grow border-none">
783790
<ProjectAvatar

0 commit comments

Comments
 (0)