Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
# APP-4080: Use Latest User Prompt as Conversation Title in Tab Names
|
||||
|
||||
## Summary
|
||||
|
||||
Add a user setting named `Use latest user prompt as conversation title in tab names` that controls which conversation text Warp shows in vertical tabs for agent conversations.
|
||||
|
||||
The setting is disabled by default. In the default disabled state, vertical tabs use conversation titles for both Oz agent conversations and plugin-backed third-party CLI agent sessions. When enabled, vertical tabs use the latest user prompt when one is available, consistently across the same agent conversation types.
|
||||
|
||||
The desired outcome is that Warp's default tab-name behavior uses stable, title-like conversation labels, while users who prefer prompt-based labels can explicitly opt into using the latest prompt.
|
||||
|
||||
## Problem
|
||||
|
||||
Vertical tabs are a primary navigation surface for users who keep multiple terminal and agent sessions open. Agent rows need a short piece of conversation text that helps users recognize which conversation is which.
|
||||
|
||||
Today, the behavior is inconsistent:
|
||||
|
||||
- Oz agent conversations use the conversation title when available.
|
||||
- Plugin-backed third-party CLI agent sessions use the latest user prompt ahead of title-like session metadata.
|
||||
|
||||
That makes the same vertical-tabs surface feel unpredictable. Users cannot rely on "agent conversation text" meaning the same thing across Oz and third-party agents, and users who prefer prompt-based labels do not have a single opt-in setting that applies to both.
|
||||
|
||||
## Goals
|
||||
|
||||
- Add one user-facing setting named `Use latest user prompt as conversation title in tab names`.
|
||||
- Default the setting to disabled, so tab names use conversation titles unless the user opts into prompt-based labels.
|
||||
- Apply the setting consistently to Oz agent conversations and plugin-backed third-party CLI agent sessions.
|
||||
- Provide a prompt-based option for users who prefer the latest user prompt as the vertical-tab label.
|
||||
- Keep non-agent terminal panes and non-plugin-backed CLI agent detections on their current terminal fallback behavior.
|
||||
- Make vertical-tabs row text, vertical-tabs search, and vertical-tabs detail-sidecar text agree on the same selected conversation text.
|
||||
|
||||
## Non-goals
|
||||
|
||||
- Changing how conversation titles are generated.
|
||||
- Adding manual per-conversation renaming.
|
||||
- Changing pane header titles, horizontal tab titles, the command palette conversation list, or the conversation list panel.
|
||||
- Changing plain terminal pane title precedence.
|
||||
- Adding support for third-party CLI sessions that do not expose plugin-backed session metadata.
|
||||
- Redesigning the vertical tabs settings UI beyond adding this setting in the appropriate AI settings area.
|
||||
|
||||
## Figma / design references
|
||||
|
||||
Figma: none provided
|
||||
|
||||
Use the existing settings UI patterns for a simple toggle.
|
||||
|
||||
## User experience
|
||||
|
||||
### Setting location and default
|
||||
|
||||
Warp exposes a setting in the AI settings area, near settings that affect agent input or agent conversation behavior.
|
||||
|
||||
The setting should communicate that it opts into prompt-based agent tab names. Suggested copy:
|
||||
|
||||
- Setting label: `Use latest user prompt as conversation title in tab names`
|
||||
- Description: `Show the latest user prompt instead of the generated conversation title for Oz and third-party agent sessions in vertical tabs.`
|
||||
|
||||
The setting is disabled by default for all users.
|
||||
|
||||
### Eligible conversations
|
||||
|
||||
The setting applies only to agent conversations shown as terminal rows in the vertical tabs panel:
|
||||
|
||||
- Oz agent conversations, including local agent conversations and cloud agent conversations shown in Warp.
|
||||
- Plugin-backed third-party CLI agent sessions, such as supported Claude Code, Codex, or similar sessions where Warp receives structured session metadata from the agent plugin.
|
||||
|
||||
The setting does not apply to:
|
||||
|
||||
- Plain terminal panes.
|
||||
- CLI agent sessions detected only from a running command when no plugin-backed session metadata is available.
|
||||
- Non-terminal panes such as code panes, notebooks, workflows, settings, files, or Warp Drive objects.
|
||||
|
||||
### Disabled behavior: use conversation title
|
||||
|
||||
When the setting is disabled, vertical tabs should show the best available conversation title for eligible agent rows. This is the default behavior.
|
||||
|
||||
For Oz agent conversations:
|
||||
|
||||
- Show the generated conversation title when it exists and is non-empty.
|
||||
- If the generated title is not yet available, show the best available title fallback for the conversation, such as the initial user prompt or an explicit default title for empty conversations.
|
||||
- Empty new conversations continue to use existing placeholder copy such as `New agent conversation` or `New cloud agent`.
|
||||
|
||||
For plugin-backed third-party CLI agent sessions:
|
||||
|
||||
- Show the agent session's title-like metadata when it exists and is non-empty.
|
||||
- Title-like metadata should represent a stable conversation/session title or summary, not merely the most recent user prompt.
|
||||
- If no title-like metadata is available yet, fall back to the latest user prompt when available.
|
||||
- If neither title-like metadata nor a user prompt is available, keep the existing terminal fallback behavior.
|
||||
|
||||
When a title becomes available or changes while the row is visible, the vertical tab text updates in place without requiring the user to switch tabs, reopen the panel, or restart the session.
|
||||
|
||||
### Enabled behavior: use latest user prompt
|
||||
|
||||
When the setting is enabled, vertical tabs should show the latest available user prompt for eligible agent rows.
|
||||
|
||||
For Oz agent conversations:
|
||||
|
||||
- Show the latest user-authored prompt in the active conversation when one exists.
|
||||
- If there is no user prompt yet, fall back to the same placeholder or terminal fallback that the default title behavior would use for an empty conversation.
|
||||
|
||||
For plugin-backed third-party CLI agent sessions:
|
||||
|
||||
- Show the latest user prompt provided by the plugin session metadata when it exists.
|
||||
- If no user prompt is available, fall back to title-like metadata if available.
|
||||
- If neither prompt nor title-like metadata is available, keep the existing terminal fallback behavior.
|
||||
|
||||
Changing the setting updates existing vertical-tabs rows on the next settings refresh or normal UI update; users should not need to create new conversations for the setting to take effect.
|
||||
|
||||
### Relationship to vertical tabs display settings
|
||||
|
||||
The setting controls the agent "conversation text" value used by vertical tabs. It does not force that value to be the primary row text in every vertical-tabs configuration.
|
||||
|
||||
Specifically:
|
||||
|
||||
- When the vertical tabs primary info setting is configured to show command/conversation text, eligible agent rows use this setting to choose between title and latest user prompt.
|
||||
- When the compact subtitle setting is configured to show command/conversation text, eligible agent row subtitles use this setting to choose between title and latest user prompt.
|
||||
- The vertical-tabs detail sidecar uses this setting for the command/conversation text field of eligible agent pane sections.
|
||||
- When vertical tabs are configured to prioritize working directory or branch instead of command/conversation text, the primary row may continue to show that non-conversation metadata.
|
||||
|
||||
The setting must not change working-directory, branch, PR, diff-stat, status, or kind-badge rendering.
|
||||
|
||||
### Manual tab names and title overrides
|
||||
|
||||
If the user has manually renamed a tab or pane in a way that creates an explicit vertical-tabs title override, that user-provided override remains higher priority than this setting.
|
||||
|
||||
In that case:
|
||||
|
||||
- The visible overridden title remains unchanged.
|
||||
- The setting may still affect secondary conversation text in places that do not use the override, such as the detail sidecar's conversation text field.
|
||||
- Toggling the setting must not clear or rewrite the manual name.
|
||||
|
||||
### Status and metadata behavior
|
||||
|
||||
Agent status indicators remain independent from the conversation text setting.
|
||||
|
||||
- Oz rows keep existing Oz status behavior.
|
||||
- Plugin-backed third-party CLI agent rows keep existing agent-specific status behavior.
|
||||
- Plain terminal rows keep existing terminal status and title fallback behavior.
|
||||
|
||||
The setting only chooses the text used to identify the conversation; it does not alter whether a row is considered an Oz row, a third-party agent row, or a terminal row.
|
||||
|
||||
### Empty, missing, and stale metadata
|
||||
|
||||
Fallback behavior should avoid blank vertical-tab labels.
|
||||
|
||||
- Empty strings and whitespace-only titles or prompts are treated as missing.
|
||||
- If the preferred text type is missing, Warp falls back to the other text type when available.
|
||||
- If both title-like metadata and prompt metadata are missing, Warp uses the existing terminal fallback chain.
|
||||
- A stale previous prompt must not replace a newer conversation title when the setting is disabled and the newer title is available.
|
||||
- A stale title must not replace a newer user prompt when the setting is enabled and the newer prompt is available.
|
||||
|
||||
### Search behavior
|
||||
|
||||
Vertical-tabs search should include the same conversation text that is visibly rendered for eligible agent rows.
|
||||
|
||||
For discoverability, search may also include the non-rendered counterpart when available. For example, when the setting is disabled and the title is visible, searching for the latest user prompt may still match the row. However, the visible row text after filtering should continue to follow the setting.
|
||||
|
||||
### Scope across app sessions and devices
|
||||
|
||||
The setting is a user preference and should persist across app restarts.
|
||||
|
||||
If Warp normally syncs comparable AI display preferences across devices, this setting should follow that same sync behavior. If comparable AI display preferences are local-only, this setting should follow that local-only behavior instead.
|
||||
|
||||
## Success criteria
|
||||
|
||||
1. A user can find a setting in the AI settings area named `Use latest user prompt as conversation title in tab names`.
|
||||
2. The setting is disabled by default.
|
||||
3. With the setting disabled, an Oz agent conversation row in vertical tabs shows the generated conversation title when one exists.
|
||||
4. With the setting disabled, a plugin-backed third-party CLI agent session row in vertical tabs shows title-like session metadata when one exists, instead of preferring the latest user prompt.
|
||||
5. With the setting enabled, an Oz agent conversation row in vertical tabs shows the latest user-authored prompt when one exists.
|
||||
6. With the setting enabled, a plugin-backed third-party CLI agent session row in vertical tabs shows the latest user prompt when one exists.
|
||||
7. Oz and plugin-backed third-party CLI agent sessions follow the same setting semantics: disabled prefers title, enabled prefers latest user prompt.
|
||||
8. Empty or whitespace-only titles and prompts are ignored, and rows fall back to non-empty text rather than rendering blank labels.
|
||||
9. Empty Oz conversations continue to show existing placeholder copy such as `New agent conversation` or `New cloud agent`.
|
||||
10. Third-party CLI agent sessions without plugin-backed metadata keep the existing terminal fallback behavior.
|
||||
11. Plain terminal rows keep the existing terminal title / last command / new session fallback behavior.
|
||||
12. Vertical-tabs primary row text, compact command/conversation subtitles, and detail-sidecar command/conversation text all use the same setting-driven conversation text for eligible agent rows.
|
||||
13. Vertical-tabs search matches the visible setting-driven conversation text for eligible agent rows.
|
||||
14. Toggling the setting updates existing eligible rows without creating new conversations.
|
||||
15. Manual tab or pane title overrides remain higher priority than the setting and are not cleared by toggling it.
|
||||
16. Agent status pills, kind badges, PR badges, diff-stat badges, branch text, and working-directory text are unchanged by the setting.
|
||||
17. The setting persists across app restarts.
|
||||
|
||||
## Validation
|
||||
|
||||
- **Default setting state**: Install or reset settings, open the AI settings area, and verify `Use latest user prompt as conversation title in tab names` is disabled by default.
|
||||
- **Oz title default**: Create an Oz conversation that receives a generated title. With vertical tabs enabled and the setting disabled, verify the row shows the generated title rather than the latest prompt text.
|
||||
- **Oz prompt enabled**: Enable the setting, send a follow-up prompt in the same Oz conversation, and verify the vertical-tabs conversation text updates to the latest user prompt.
|
||||
- **Oz empty conversation**: Start a new empty local Oz conversation and a new empty cloud agent conversation. Verify placeholder copy remains non-empty and appropriate.
|
||||
- **Third-party title default**: Start a plugin-backed third-party CLI agent session with title-like session metadata and a user prompt. With the setting disabled, verify the vertical-tab row shows the title-like metadata rather than the prompt.
|
||||
- **Third-party prompt enabled**: Enable the setting in the same plugin-backed session and verify the row shows the latest user prompt.
|
||||
- **Missing metadata fallback**: Test a plugin-backed third-party session before title-like metadata arrives. Verify the row falls back to prompt text when available and never renders blank text.
|
||||
- **No-plugin fallback**: Start a CLI agent session detected only from the running command without plugin metadata. Verify the row keeps the existing terminal fallback behavior regardless of the setting.
|
||||
- **Compact subtitle**: Configure compact vertical tabs so additional metadata shows command/conversation text. Toggle the setting and verify the subtitle changes consistently for Oz and plugin-backed third-party agent rows.
|
||||
- **Detail sidecar**: Hover an eligible Oz row and an eligible third-party agent row. Verify the sidecar's command/conversation text follows the setting.
|
||||
- **Search**: Search vertical tabs for the visible title/prompt text and verify the correct eligible agent row matches.
|
||||
- **Manual override**: Rename a tab or pane, toggle the setting, and verify the manual title remains visible and unchanged.
|
||||
- **Regression / plain terminal**: Open a plain terminal pane and verify its vertical-tab label precedence remains unchanged.
|
||||
- **Persistence**: Toggle the setting, restart Warp, and verify the setting value and vertical-tabs behavior are preserved.
|
||||
|
||||
## Open questions
|
||||
|
||||
- What exact storage/sync policy should this setting use relative to existing AI display settings?
|
||||
- What exact title-like field should third-party CLI agent plugins expose or map into if they currently only provide prompt and summary metadata?
|
||||
@@ -0,0 +1,216 @@
|
||||
# APP-4080: Use Latest User Prompt as Conversation Title in Tab Names
|
||||
|
||||
## Problem
|
||||
Vertical tabs currently resolve agent terminal row text in several places, and the Oz and plugin-backed CLI agent paths use different semantics.
|
||||
Oz rows call through `TerminalView::selected_conversation_display_title`, which ultimately uses `AIConversation::title()`: generated task description, then an initial prompt-style fallback, then explicit fallback title. Plugin-backed CLI agent rows call `CLIAgentSessionContext::display_title()`, which currently prefers the latest plugin `query` over `summary`. The new setting needs to make this choice consistent:
|
||||
- setting off/default: prefer conversation title/title-like metadata
|
||||
- setting on: prefer latest user prompt
|
||||
|
||||
The technical work is to add the setting, expose it in AI settings, and route all vertical-tabs conversation-text call sites through shared resolution logic so row rendering, compact subtitles, detail sidecar, and search stay in sync.
|
||||
|
||||
## Relevant code
|
||||
- `specs/APP-4080/PRODUCT.md` — source of truth for desired behavior.
|
||||
- `app/src/settings/ai.rs:551` — `AISettings` group where persisted AI settings are declared.
|
||||
- `app/src/settings/ai.rs:1246` — existing user-visible AI setting with global sync policy, useful as the sync/default pattern.
|
||||
- `app/src/settings_view/ai_page.rs:1368` — AI settings page widget registration order.
|
||||
- `app/src/settings_view/ai_page.rs:1870` — `AISettingsPageAction`, where the toggle action should be added.
|
||||
- `app/src/settings_view/ai_page.rs:2461` — settings action handling for persisted toggle settings.
|
||||
- `app/src/settings_view/ai_page.rs:4910` — `OtherAIWidget`, currently home for conversation/display-adjacent AI settings such as conversation history and thinking display.
|
||||
- `app/src/terminal/view/pane_impl.rs:945` — Oz conversation selection/title helpers for user-facing chrome.
|
||||
- `app/src/ai/agent/conversation.rs:1053` — `AIConversation::title()`, the generated-title-first path.
|
||||
- `app/src/ai/agent/conversation.rs:1121` — `AIConversation::initial_query()` and `initial_user_query()` helpers.
|
||||
- `app/src/ai/agent/mod.rs:2478` — `AIAgentInput::user_query()`, the canonical display text for user prompt-like inputs.
|
||||
- `app/src/terminal/cli_agent_sessions/mod.rs:39` — `CLIAgentSessionContext` stores plugin metadata: `summary`, `query`, etc.
|
||||
- `app/src/terminal/cli_agent_sessions/mod.rs:93` — `CLIAgentSessionContext::display_title()`, which currently prefers `query` over `summary`.
|
||||
- `app/src/terminal/cli_agent_sessions/event/mod.rs:27` and `event/v1.rs:53` — CLI plugin payload parsing for `query` and `summary`.
|
||||
- `app/src/workspace/view/vertical_tabs.rs:2217` — vertical-tabs search text for terminal rows.
|
||||
- `app/src/workspace/view/vertical_tabs.rs:2237` — `terminal_primary_line_data()` fallback chain.
|
||||
- `app/src/workspace/view/vertical_tabs.rs:2679` — main terminal row command/conversation text rendering.
|
||||
- `app/src/workspace/view/vertical_tabs.rs:4079` — detail sidecar terminal conversation text.
|
||||
- `app/src/workspace/view/vertical_tabs.rs:4613` — compact subtitle command/conversation text.
|
||||
- `app/src/workspace/view/vertical_tabs_tests.rs:331` — existing terminal primary-line precedence tests.
|
||||
- `app/src/terminal/cli_agent_sessions/mod_tests.rs:186` — existing CLI session metadata tests.
|
||||
|
||||
## Current state
|
||||
`vertical_tabs.rs` repeats the same terminal-agent extraction pattern in at least four call sites:
|
||||
- `terminal_pane_search_text_fragments`
|
||||
- `render_terminal_primary_line_for_view`
|
||||
- `render_terminal_detail_section`
|
||||
- the `VerticalTabsCompactSubtitle::Command` branch in `render_compact_pane_row`
|
||||
|
||||
Each call site:
|
||||
1. reads `CLIAgentSessionsModel::session(terminal_view.id())`
|
||||
2. suppresses agent metadata for non-plugin-backed CLI sessions
|
||||
3. calls `terminal_view.selected_conversation_display_title(app)` for Oz
|
||||
4. calls `session.session_context.display_title()` for plugin-backed CLI agents
|
||||
5. passes both values into `terminal_primary_line_data()`
|
||||
|
||||
`terminal_primary_line_data()` then prefers CLI agent text over Oz conversation text, and only falls through to terminal title, last completed command, and `New session` when no agent text is available.
|
||||
|
||||
This works for the current UI but makes APP-4080 easy to implement inconsistently because the new setting would otherwise need to be read at every duplicated extraction site.
|
||||
|
||||
## Proposed changes
|
||||
### Add the setting
|
||||
Add a new boolean setting to `AISettings` in `app/src/settings/ai.rs`.
|
||||
|
||||
Suggested setting:
|
||||
- field: `use_latest_user_prompt_as_conversation_title_in_tab_names`
|
||||
- generated setting type: `UseLatestUserPromptAsConversationTitleInTabNames`
|
||||
- default: `false`
|
||||
- supported platforms: `SupportedPlatforms::ALL`
|
||||
- sync: `SyncToCloud::Globally(RespectUserSyncSetting::Yes)`
|
||||
- private: `false`
|
||||
- TOML path: `agents.display.use_latest_user_prompt_as_conversation_title_in_tab_names`
|
||||
- description: `Whether agent tab names use the latest user prompt instead of the generated conversation title.`
|
||||
|
||||
The sync policy should match similar user-visible display/AI behavior preferences. The setting affects the user's preferred navigation chrome rather than machine-local state, so global sync is preferable.
|
||||
|
||||
### Add the settings UI
|
||||
Add `UseLatestUserPromptAsConversationTitleInTabNames` to the imports in `app/src/settings_view/ai_page.rs`.
|
||||
|
||||
Add an action:
|
||||
- `AISettingsPageAction::ToggleUseLatestUserPromptAsConversationTitleInTabNames`
|
||||
|
||||
Handle the action by toggling `AISettings::use_latest_user_prompt_as_conversation_title_in_tab_names` with `toggle_and_save_value(ctx)` and notifying the view.
|
||||
|
||||
Render the toggle in `OtherAIWidget`, near `Show conversation history in tools panel` and `Agent thinking display`, because it is a conversation display/navigation preference rather than an input-routing behavior. Suggested label:
|
||||
- `Use latest user prompt as conversation title in tab names`
|
||||
|
||||
Suggested description:
|
||||
- `Show the latest user prompt instead of the generated conversation title for Oz and third-party agent sessions in vertical tabs.`
|
||||
|
||||
Because the setting also affects plugin-backed third-party CLI agent sessions, do not make editability depend exclusively on `AISettings::is_any_ai_enabled(app)`. The row can still use standard AI settings styling, but the toggle should remain usable for users who keep Warp AI disabled while using third-party coding agents.
|
||||
|
||||
### Centralize agent tab text resolution
|
||||
Introduce a small private resolver in `app/src/workspace/view/vertical_tabs.rs` so every vertical-tabs call site uses the same setting semantics.
|
||||
|
||||
Suggested private types in `vertical_tabs.rs`:
|
||||
- `AgentTabTextPreference` with variants `ConversationTitle` and `LatestUserPrompt`
|
||||
- `TerminalAgentText` containing:
|
||||
- `conversation_display_title: Option<String>`
|
||||
- `cli_agent_title: Option<String>`
|
||||
- `is_oz_agent: bool`
|
||||
- `cli_agent: Option<CLIAgent>`
|
||||
|
||||
Suggested helpers:
|
||||
- `agent_tab_text_preference(app: &AppContext) -> AgentTabTextPreference`
|
||||
- `terminal_agent_text(terminal_view: &TerminalView, app: &AppContext) -> TerminalAgentText`
|
||||
|
||||
`terminal_agent_text()` should own the plugin-backed suppression rule:
|
||||
- if a CLI agent session exists and `listener.is_none()`, do not use CLI or Oz conversation metadata for the row; preserve current terminal fallback behavior
|
||||
- otherwise resolve Oz and CLI text according to the setting
|
||||
|
||||
`terminal_primary_line_data()` can remain as the pure fallback combiner once the agent text has been chosen. This avoids coupling it directly to settings or `AppContext`, and keeps existing unit tests easy to extend.
|
||||
|
||||
### Oz conversation prompt support
|
||||
Add a helper on `AIConversation`:
|
||||
- `latest_user_prompt_for_tab_name(&self) -> Option<String>`
|
||||
|
||||
Implementation should iterate `root_task_exchanges()` in reverse order and find the latest non-empty `AIAgentInput::user_query()` value. This uses the existing display-oriented prompt helper, which already accounts for slash-command-like inputs such as plan/orchestrate, create project, clone repository, code review, invoke skill, and accepted suggested prompts.
|
||||
|
||||
Keep `AIConversation::title()` unchanged. The new helper is only for the explicit latest-prompt tab-name setting.
|
||||
|
||||
Update `TerminalView` in `app/src/terminal/view/pane_impl.rs` with either:
|
||||
- a new method such as `selected_conversation_tab_name_text(use_latest_user_prompt, ctx)`, or
|
||||
- a new private helper used by vertical tabs to access the selected `AIConversation`
|
||||
|
||||
Prefer not to change existing pane-header behavior. `selected_conversation_display_title()` should keep serving pane headers and other existing chrome with title semantics.
|
||||
|
||||
### CLI agent title/prompt support
|
||||
Extend `CLIAgentSessionContext` with explicit methods instead of overloading `display_title()`:
|
||||
- `latest_user_prompt(&self) -> Option<String>` returns trimmed non-empty `query`
|
||||
- `title_like_text(&self) -> Option<String>` returns trimmed non-empty title-like metadata
|
||||
|
||||
Keep the preference application in `vertical_tabs.rs` rather than making `terminal::cli_agent_sessions` depend on a workspace/view-specific enum.
|
||||
|
||||
For the current protocol, `summary` is the only available title-like field. Use it as `title_like_text()` for APP-4080, but keep the method boundary explicit so a future plugin protocol can add a dedicated `title` field without touching vertical tabs again.
|
||||
|
||||
Do not use CLI agent text for non-plugin-backed detections. Those sessions should continue to fall through to terminal title/last command.
|
||||
|
||||
### Update vertical tabs call sites
|
||||
Replace duplicated local extraction with `terminal_agent_text()` in:
|
||||
- `terminal_pane_search_text_fragments`
|
||||
- `render_terminal_primary_line_for_view`
|
||||
- `render_terminal_detail_section`
|
||||
- `render_compact_pane_row` when `VerticalTabsCompactSubtitle::Command`
|
||||
|
||||
Search should include the visibly rendered setting-driven text. If adding the non-rendered counterpart is cheap after centralization, include both title-like text and latest prompt in `terminal_search_text_fragments()` for eligible agent rows, while keeping `primary_text` as the visible setting-driven text.
|
||||
|
||||
### Keep generated schemas/settings in sync
|
||||
Adding an `AISettings` field may require updating generated or checked-in settings schema artifacts if this repository expects those to change. Follow the existing settings workflow in the repo after implementation; do not hand-edit generated schema files unless that is the established pattern for this codebase.
|
||||
|
||||
## End-to-end flow
|
||||
1. User opens Settings > AI and sees `Use latest user prompt as conversation title in tab names` disabled by default.
|
||||
2. Vertical tabs render a terminal row.
|
||||
3. The row asks `terminal_agent_text()` for Oz/CLI conversation text.
|
||||
4. `terminal_agent_text()` reads `AISettings::use_latest_user_prompt_as_conversation_title_in_tab_names`.
|
||||
5. For Oz:
|
||||
- disabled: use `AIConversation::title()`, with existing empty-conversation default title handling
|
||||
- enabled: use `AIConversation::latest_user_prompt_for_tab_name()`, falling back to title/default text
|
||||
6. For plugin-backed CLI agents:
|
||||
- disabled: use `CLIAgentSessionContext::title_like_text()`, falling back to latest prompt
|
||||
- enabled: use `CLIAgentSessionContext::latest_user_prompt()`, falling back to title-like text
|
||||
7. `terminal_primary_line_data()` receives already-selected agent text and preserves the existing terminal fallback chain.
|
||||
8. Row rendering, compact subtitles, detail sidecar, and search use the same selected text.
|
||||
|
||||
## Diagram
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Settings[AISettings: use_latest_user_prompt_as_conversation_title_in_tab_names]
|
||||
VTabs[vertical_tabs.rs terminal_agent_text]
|
||||
Oz[TerminalView selected AIConversation]
|
||||
CLI[CLIAgentSessionsModel session]
|
||||
Primary[terminal_primary_line_data]
|
||||
Surfaces[Row text / Compact subtitle / Detail sidecar / Search]
|
||||
|
||||
Settings --> VTabs
|
||||
Oz --> VTabs
|
||||
CLI --> VTabs
|
||||
VTabs --> Primary
|
||||
Primary --> Surfaces
|
||||
```
|
||||
|
||||
## Risks and mitigations
|
||||
- **Duplicated resolution stays inconsistent**: centralize the setting read in one helper and make all four vertical-tabs call sites use it.
|
||||
- **Pane headers accidentally change**: keep `TerminalView::selected_conversation_display_title()` title-first for existing chrome; add a new tab-specific helper rather than changing the existing method globally.
|
||||
- **Third-party `summary` may not be a durable title**: hide this behind `CLIAgentSessionContext::title_like_text()` and treat a dedicated plugin `title` payload field as a follow-up if needed.
|
||||
- **Global AI disabled blocks a third-party setting**: make the UI toggle usable even when Warp AI is disabled, since the setting also affects plugin-backed third-party CLI sessions.
|
||||
- **Blank or whitespace text**: trim and filter every title/prompt candidate before choosing it.
|
||||
- **Search mismatch**: test that search includes the visible text after toggling. If both title and prompt are indexed, make sure rendered text still follows the setting.
|
||||
|
||||
## Testing and validation
|
||||
Add or update unit tests:
|
||||
- `app/src/ai/agent/conversation.rs` tests for `latest_user_prompt_for_tab_name()`:
|
||||
- returns the latest non-empty user prompt across root-task exchanges
|
||||
- ignores exchanges without user prompt text
|
||||
- returns `None` for empty conversations
|
||||
- `app/src/terminal/cli_agent_sessions/mod_tests.rs` tests for `CLIAgentSessionContext`:
|
||||
- default/title preference returns `summary` before `query`
|
||||
- latest-prompt preference returns `query` before `summary`
|
||||
- empty/whitespace values fall through
|
||||
- `app/src/workspace/view/vertical_tabs_tests.rs` tests for any pure helper added in `vertical_tabs.rs`:
|
||||
- setting off: CLI title-like text wins over latest prompt
|
||||
- setting on: latest prompt wins over title-like text
|
||||
- missing preferred text falls back to the other agent text
|
||||
- no plugin-backed metadata preserves terminal title/last-command fallback
|
||||
- `app/src/settings/ai_tests.rs` or an adjacent settings test:
|
||||
- new setting defaults to `false`
|
||||
- setting persists through the normal settings machinery
|
||||
|
||||
Manual validation:
|
||||
- Default-off Oz conversation shows generated title in vertical tabs.
|
||||
- Toggle on and send an Oz follow-up prompt; row, compact command subtitle, detail sidecar, and search reflect the latest prompt.
|
||||
- Plugin-backed CLI agent with both summary and query shows summary/title-like text by default and query when toggled on.
|
||||
- Non-plugin CLI detection and plain terminal rows keep existing fallback behavior.
|
||||
|
||||
Suggested targeted commands after implementation:
|
||||
- `cargo test -p warp workspace::view::vertical_tabs_tests`
|
||||
- `cargo test -p warp terminal::cli_agent_sessions::mod_tests`
|
||||
- `cargo test -p warp settings::ai_tests`
|
||||
|
||||
Do not run `cargo fmt --all` or file-specific `cargo fmt`; follow the repository formatting guidance when implementation changes are made.
|
||||
|
||||
## Follow-ups
|
||||
- Add an explicit `title` field to the CLI agent plugin protocol if `summary` is not sufficiently stable for tab names.
|
||||
- Consider telemetry for the setting toggle only if product wants adoption data; the implementation does not need telemetry to satisfy APP-4080.
|
||||
- If vertical-tabs search indexes both rendered and non-rendered counterpart text, document that behavior in a small helper test so future changes do not accidentally regress discoverability.
|
||||
Reference in New Issue
Block a user