Skip to content

Chat and file tab strip: follow-ups #15

Done

Description

@andrebrait

Follow-ups to the chat and file tab strip (phase 2 of the Pendant-style layout), left for the polish phase:

  • Chat tab labels can go stale. A tab keeps the session it was opened with. A rename in the sidebar, or a generated title, reaches the tab only when that conversation is shown again. Take labels from the sidebar's session list instead.
  • Tabs for sessions deleted or archived elsewhere stay open. Only this browser tab's delete or archive closes a chat tab. Prune tabs against the session list, and apply the sidebar's offline-host check when a tab is clicked.
  • Tabs are not kept across a reload, and there is no limit or preview tab. Decide whether opening a conversation from the sidebar replaces a preview tab, and whether the strip is restored after a reload.
  • The strip hides its overflow. It scrolls to keep the active tab in view with no visible scrollbar or overflow cue, so tabs to the left can look closed.
  • Focus around a covered chat. Opening a file over a focused composer leaves focus on the page; closing the file does not return it.
  • Tests still missing: Esc and presence while a file covers the chat, the neighbour choice when closing the shown chat, and closing the last chat into a new one.
  • Delete and archive requests name only the session id. The server picks the owning host (hostForSessionId), so with a copied id across hosts it can act on a different host's session than the sidebar row. This predates the tab strip, and the strip and the chat reset now match by host and id. Tracked here from the PR feat(ui): chats and files open as tabs in one strip above the chat #16 review.

Activity

  1. andrebrait commented on Nov 25, 2026

    @andrebrait
    ContributorAuthor

    Follow-ups from the tab groups PR (#17), deferred from its review:

    • Presence for visible background chats. A chat shown in another group still counts as unviewed, so its "Completed" notification fires although it is on screen. Presence reports only the selected chat.
    • New chat in its own group. Clicking into another group drops an unsent new chat's tab, and with it the group if that was its only tab. The draft survives in the store. The new-chat tab exists only while the new chat is selected, as before.
    • Layout persistence. Groups, their tabs and their sizes live in memory until reload, alongside the strip persistence already listed here.
    • Moving a tab between groups remounts what it shows, and a split remounts the hidden views of the tabs that stay behind. A stable per-tab layer outside the groups would remove both.
  2. andrebrait commented on Nov 25, 2026

    @andrebrait
    ContributorAuthor

    Follow-ups from the Search tab PR (#18), deferred from its review:

    • Search and the file index search the session's cwd, not the panel's. With a sessionId, /api/file-search (and /api/file-index) searches the session's own cwd and ignores the cwd sent. After a session's worktree was removed, the Files tab shows the sidebar folder while Search answers directory_not_found. Results already open against the cwd that was searched. Fix both routes together: search the requested cwd, authorized against the session's roots.
    • Search blocks the daemon on hard-linked trees. Each listed file gets a synchronous realpath. A hard-linked file (pnpm's node_modules outside Git, for example) also gets the full isPiSecretFile check, which reads the agent directory each time. Use async realpath, and check a hard link against the agent directory's secret identities computed once per search.
  3. andrebrait commented on Nov 26, 2026

    @andrebrait
    ContributorAuthor

    Status after #19, #20 and #21:

    Resolved

    Still open from the lists above (phase 5d):

    • Search and the file index use the session's cwd, not the panel's.
    • Search is slow on hard-linked trees.
    • Delete and archive name only the session id. The restored-tab 404 check in feat(ui): keep tabs and tab groups across reloads #20 is host-blind for the same reason.
    • No tests for Esc and presence while a file covers the chat.

    New, deferred from the #21 review

    • Another new chat while a kept one is still being created. If a new chat was sent and left for another group's chat, and another new chat starts before the first one's session is created, its tab closes. The session is still created and listed in the sidebar, as it was before feat(ui): presence for every chat on screen, tab views kept across groups, new chat kept in its group #21. Keeping the tab needs the chat to report a creation in flight.
    • The back-gesture guard can put back an older address. useSidebarHistory pushes an extra history entry while a draft is unsent and collapses it when the draft goes. If the user switched chats meanwhile, the collapse returns to the base entry, which still holds the earlier URL (/), while the newer chat stays selected. It showed up when a new chat sends after the user moved to another group.
  4. andrebrait commented on Nov 26, 2026

    @andrebrait
    ContributorAuthor

    #22 covers the 5d items: the panel's folder for search and the file index, search cost on hard-linked trees, delete, archive and the restored-tab check scoped by host, and the Esc test while a file covers the chat. #21 is merged.

    Deferred from the #22 review (most predate it):

    • State kept by session id alone cannot tell copies apart. GitHub watches, outbox retry lineage and exit marks belong to every copy of an id copied across hosts. fix: search the panel's folder, faster search on hard-linked trees, host-qualified delete and archive #22 keeps them while another host is known to have a copy, from that host's running child or its last list, and otherwise removes them as before. A host whose list was never loaded counts as having none. The fix is keying that state by host.
    • Other session routes are still host-blind for a copied id: PATCH (rename), export, context, auto-name, state, matches, subagents and resolveWorkspaceHost. The workspace routes keep their 409 workspace_host_mismatch for the named host's copy.
    • A host-owned live child is not stopped by a delete (destroyAndWait runs only without hostOwnedLifecycle), so pi may write the file again.
    • Credential checks:
      • PI_SECRET_NAME uses .* without the s flag, so a suffix with a line break is not seen as a credential name.
      • A hard link to a file deeper in <agent>/tau/ (cluster-config copies) is not denied.
  5. andrebrait commented on Nov 27, 2026

    @andrebrait
    ContributorAuthor

    Status after #32, #33 and #34:

    Resolved

    Still open

    • State kept by session id alone, which cannot tell copies on different hosts apart:
      • outbox entries and retry lineage (the state route's outbox snapshot included);
      • GitHub watches;
      • exit marks.
    • /api/agent/[id] commands and the live-wrapper registry (one wrapper per id) are host-blind.
    • A sidebar row's selected state compares the id only, so both hosts' copies of an id show as selected (CodeRabbit on fix(sessions): scope the remaining session routes to the host the request names #33).
    • From fix(tabs): keep a sent new chat's tab when another new chat starts #34's known limits:
      • two new chats on one workspace share the new:<cwd> draft. A failed send of a kept chat restores its text into the fresh chat too.
      • closing a draft tab while its send is in flight leaves the session without a tab, as replacing a shown new chat does.
  6. andrebrait commented on Nov 27, 2026

    @andrebrait
    ContributorAuthor

    Status after #35 and #36:

    Resolved

    Not changed, by design: closing a new chat's tab while its first send is in flight leaves the session without a tab. The prompt is still delivered and the session shows in the sidebar, the same as closing a running session's tab.

    Still open

    • State kept by session id alone, which cannot tell copies on different hosts apart:
      • the outbox and its retry lineage;
      • GitHub watches;
      • exit marks;
      • the sidebar's running, awaiting-input and unread marks.
    • /api/agent/[id] commands and the live-wrapper registry are host-blind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions