|
1 | | -import { createEffect, createMemo, For, Match, onMount, ParentProps, Show, Switch, type JSX } from "solid-js" |
| 1 | +import { createEffect, createMemo, For, Match, onMount, ParentProps, Show, Switch, untrack, type JSX } from "solid-js" |
2 | 2 | import { DateTime } from "luxon" |
3 | 3 | import { A, useNavigate, useParams } from "@solidjs/router" |
4 | 4 | import { useLayout, getAvatarColors, LocalProject } from "@/context/layout" |
@@ -319,8 +319,11 @@ export default function Layout(props: ParentProps) { |
319 | 319 | createEffect(() => { |
320 | 320 | if (!params.dir || !params.id) return |
321 | 321 | const directory = base64Decode(params.dir) |
322 | | - setStore("lastSession", directory, params.id) |
323 | | - notification.session.markViewed(params.id) |
| 322 | + const id = params.id |
| 323 | + setStore("lastSession", directory, id) |
| 324 | + notification.session.markViewed(id) |
| 325 | + untrack(() => layout.projects.expand(directory)) |
| 326 | + requestAnimationFrame(() => scrollToSession(id)) |
324 | 327 | }) |
325 | 328 |
|
326 | 329 | createEffect(() => { |
@@ -467,7 +470,12 @@ export default function Layout(props: ParentProps) { |
467 | 470 | class="flex flex-col min-w-0 text-left w-full focus:outline-none" |
468 | 471 | > |
469 | 472 | <div class="flex items-center self-stretch gap-6 justify-between transition-[padding] group-hover/session:pr-7 group-focus-within/session:pr-7 group-active/session:pr-7"> |
470 | | - <span class="text-14-regular text-text-strong overflow-hidden text-ellipsis truncate"> |
| 473 | + <span |
| 474 | + classList={{ |
| 475 | + "text-14-regular text-text-strong overflow-hidden text-ellipsis truncate": true, |
| 476 | + "animate-pulse": isWorking(), |
| 477 | + }} |
| 478 | + > |
471 | 479 | {props.session.title} |
472 | 480 | </span> |
473 | 481 | <div class="shrink-0 group-hover/session:hidden group-active/session:hidden group-focus-within/session:hidden"> |
@@ -515,7 +523,15 @@ export default function Layout(props: ParentProps) { |
515 | 523 | onClick={() => dialog.show(() => <DialogSessionRenameGlobal session={props.session} />)} |
516 | 524 | /> |
517 | 525 | </Tooltip> |
518 | | - <Tooltip placement="right" value="Archive session"> |
| 526 | + <Tooltip |
| 527 | + placement="right" |
| 528 | + value={ |
| 529 | + <div class="flex items-center gap-2"> |
| 530 | + <span>Archive session</span> |
| 531 | + <span class="text-icon-base text-12-medium">{command.keybind("session.archive")}</span> |
| 532 | + </div> |
| 533 | + } |
| 534 | + > |
519 | 535 | <IconButton icon="archive" variant="ghost" onClick={() => archiveSession(props.session)} /> |
520 | 536 | </Tooltip> |
521 | 537 | </div> |
@@ -600,7 +616,15 @@ export default function Layout(props: ParentProps) { |
600 | 616 | </DropdownMenu.Content> |
601 | 617 | </DropdownMenu.Portal> |
602 | 618 | </DropdownMenu> |
603 | | - <Tooltip placement="top" value="New session"> |
| 619 | + <Tooltip |
| 620 | + placement="top" |
| 621 | + value={ |
| 622 | + <div class="flex items-center gap-2"> |
| 623 | + <span>New session</span> |
| 624 | + <span class="text-icon-base text-12-medium">{command.keybind("session.new")}</span> |
| 625 | + </div> |
| 626 | + } |
| 627 | + > |
604 | 628 | <IconButton as={A} href={`${slug()}/session`} icon="plus-small" variant="ghost" /> |
605 | 629 | </Tooltip> |
606 | 630 | </div> |
|
0 commit comments