Skip to content

Cannot rename an ai-chat node, and its tab title stays 'Loading...' after load #2380

Closed

Description

@malibio

Two related gaps in how an ai-chat node's title reaches the user. Both are small and independent of any LLM work.


1. There is no way to rename an ai-chat node

ai-chat-node-viewer.svelte:433 renders the title as a static heading:

<h2 class="chat-viewer-title">{node?.content ?? 'AI Chat'}</h2>

No contenteditable, no input, no rename affordance — and none in the sidebar's chat list either. An ai-chat's title lives in content (the schema declares no title or name field), and there is no path in the UI to edit it.

New chats therefore keep whatever they start with. The sidebar falls back to 'Untitled chat' for empty content (navigation-sidebar.svelte:294), so a list of chats reads as a stack of identical placeholder rows with no way to tell them apart.

Why this blocks the automatic-titling work

Auto-generated titles are tracked separately, and that issue's own requirements say:

Automatic title generation only fires when the current title is still "Untitled" — once a user manually sets or edits a title, the automatic mechanism must never override it

That guard is unimplementable today: it protects a user-set title, and users have no way to set one. Its Phase 1 adds the title field and the override guard but no UI to exercise it, so as scoped it would ship a "never override the user" rule that can never trigger.

Manual rename is the prerequisite, and it stands on its own regardless of when LLM titling lands.

  • The title in the ai-chat viewer header is editable in place
  • Edits persist to the node and survive reload
  • The sidebar list reflects a renamed chat without a manual refresh
  • Empty/whitespace-only titles fall back to the placeholder rather than rendering blank
  • Escape cancels an in-progress edit; blur or Enter commits
  • Works in every ai-chat viewer mode (native/openai-compat message UI and the PTY variants)

2. Tab title is stuck at "Loading..." after the node has loaded

Opening a chat from the sidebar shows a tab titled "Loading..." that never updates, even once the conversation is fully rendered.

The placeholder is deliberate — the sidebar sets it when opening a tab, at navigation-sidebar.svelte:186, :280, :313, and search-pane.svelte:98:

title: 'Loading...', // Viewer will update
title: 'Loading...', // Viewer sets the real title on mount

No viewer ever does. There is no updateTabContent / title-setting call in ai-chat-node-viewer.svelte, nor in any component under lib/components/viewers/. The comments describe a contract nothing implements, so the placeholder is permanent.

The API already exists: updateTabContent is exported from navigation.svelte.ts:603, and NavigationService.generateTabTitle (navigation-service.ts:119) already knows how to derive a title from a node.

Showing "Loading..." while the node is genuinely in flight is fine. The bug is that it never resolves afterwards.

The fix should be generic, not ai-chat-specific — every node type opened this way has the same placeholder, so any type whose title is not known at open time is affected.

  • Once a node has loaded, its tab title shows the node's real title
  • "Loading..." remains only while the node is actually being fetched
  • Renaming a node updates its open tab's title live (ties to item 1)
  • Applies to every node type opened with the placeholder, not just ai-chat
  • Covers all four current placeholder call sites, including search-pane.svelte
  • A node that fails to load does not leave the tab reading "Loading..." indefinitely

Context

Found while using a clean v0.2.7 install. The automatic-titling work is tracked separately and depends on item 1; this issue does not duplicate it — no LLM, summarization, or idle-queue work is in scope here.

Activity

  1. added
    bug
    on Sep 7, 2026
  2. mstomar125 commented on Sep 8, 2026

    @mstomar125
    Contributor

    Resolved in #2463 (merged).

    Item 1 (rename): Added click-to-edit in the ai-chat viewer header. New `ai-chat-title.ts` holds `aiChatDisplayTitle` (empty/whitespace → "Untitled chat", now shared with the sidebar's chat list instead of two independently-drifting fallbacks) and `resolveChatTitleCommit` (no-op detection so an unchanged save doesn't bump `modifiedAt`/re-run mention extraction for nothing). Sidebar list updates in place after a rename via a new `aiChatsData.updateChatContent`.

    Item 2 (stuck "Loading..."): Root cause was in `computeTabTitle` (`tab-title.ts`) — tab titles are already computed live every render off `sharedNodeStore`, so a rename already propagates to any open tab automatically; the bug was that a hydrated-but-titleless node fell back to the tab's own stale placeholder, which for a genuinely titleless node never clears. Fixed generically (applies to every node type, not just ai-chat).

    A review round caught a real regression in my first pass at the item-2 fix: the new fallback was replacing any pre-existing tab title, not just the literal "Loading..." placeholder — which broke the relationship picker's tabs (those intentionally show a related node's raw id, via `relationship-grouping.ts`'s `rowLabel`, when nothing better exists). Fixed by only replacing the exact placeholder string (`LOADING_TAB_TITLE`), preserving any other caller-supplied title through hydration.

    Scoped out, with reasoning: "a node that fails to load doesn't leave the tab stuck" — a genuinely-not-found node already closes its tab, and I deliberately did not add a bounded retry-then-close for other fetch failures: it would fight the existing, deliberate `onDaemonReconnect` design, which waits indefinitely for the daemon to become healthy rather than giving up — exactly the mechanism a fresh-install boot race depends on. A retry-then-close would reintroduce that same hang as a regression of its own.

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

    bugui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions