Skip to content

Move custom directives from chat header to a chip + popover in the chat input field #535

Description

@haiphucnguyen

Summary

Currently custom directives are displayed in the chat session header. This ticket moves them to a more contextual location — a single chip inside the chat input field area that opens a popover for managing active directives.

Motivation

  • The header location is easy to overlook and feels like a static session setting rather than an active input modifier
  • With many directives, the current header view becomes a large dropdown that takes up prominent space
  • Placing directives at the input field makes them feel like "what is shaping my next message", which is the correct mental model
  • A single chip with a popover scales cleanly from 1 to N directives without any layout issues

Implementation notes

  1. ChatInputField.kt — add a directivesChip composable row above the text input area, visible when the session has at least one directive. Chip renders active count badge when activeCount > 0.

  2. Popover — use a Popup anchored to the chip, opening upward (alignment = Alignment.TopStart with negative offset). Contains a LazyColumn of directive rows with Checkbox + label + edit icon.

  3. State — the chip needs:

    • List of all directives for the session
    • Set of currently active directive IDs
    • Toggle callback per directive
    • Add/edit callbacks
  4. Remove from header — once the chip is in place, remove the directive dropdown from the chat session header to avoid duplication.

  5. Persist toggle state — the active/inactive state per directive per session should be persisted so reopening a session restores which directives were enabled.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions