Skip to content

feat(ui): reply-quote jump navigation + thread creation fix (UI-13, UI-14)#40

Merged
Killea merged 6 commits intoKillea:mainfrom
bertheto:feat/ui-13-reply-jump
Mar 4, 2026
Merged

feat(ui): reply-quote jump navigation + thread creation fix (UI-13, UI-14)#40
Killea merged 6 commits intoKillea:mainfrom
bertheto:feat/ui-13-reply-jump

Conversation

@bertheto
Copy link
Contributor

@bertheto bertheto commented Mar 4, 2026

Summary

UI-13 -- Reply-quote jump navigation

When a message has a reply_to_msg_id, the div.msg-reply-quote is now a clickable <button> that scrolls precisely to the referenced message and briefly highlights it.

Changes:

  • index.html: div.msg-reply-quote -> button[data-reply-target] with data-msg-id on each message row
  • index.html: window.AcbScrollToMsg() uses scrollEl.scrollTo({ top: offsetTop - 12 }) (same logic as nav minimap)
  • index.html: event delegation on #messages container (no inline onclick)
  • main.css: button reset styles for .msg-reply-quote + .msg-jump-highlight outline animation

Fix -- sys-prompt visibility on thread switch

selectThread() in shared-chat.js was not clearing #sys-prompt-area before loading a new thread. The deduplication check on seq=0 found the previous thread's system prompt in the DOM and skipped rendering the new one, leaving the area empty.

Fix: Clear sysPromptAreaEl.innerHTML at the start of selectThread().

UI-14 -- Thread creation from UI modal

POST /api/threads requires X-Agent-Token + creator_agent_id. The modal was not providing these, causing a silent 401 and no thread appearing after clicking Create.

Changes:

  • shared-ui-agent.js (new): auto-registers a ui-human browser-session agent on first call, caches token in sessionStorage
  • shared-modals.js: submitThreadModal() fetches the session token and passes it as X-Agent-Token header + creator_agent_id
  • shared-api.js: fix headers merge (...options spread was silently overwriting Content-Type)
  • acb-modal-shell.js: Create button has disabled by default; enabled reactively via input listener on the topic field
  • main.css: .btn-primary:disabled style (opacity 0.4, cursor not-allowed)

Encoding

All new lines are ASCII-only. Unicode characters (U+2014, U+2026) replaced with -- / &#8230; to match project conventions from PR #38.

Test plan

  • Click a reply-quote badge -- scrolls to the target message with a brief outline highlight
  • Switch between threads -- system prompt renders correctly for each thread
  • Open New Thread modal -- Create button is disabled until topic is typed
  • Create a thread from the UI modal -- thread appears in sidebar and is auto-selected

bertheto added 6 commits March 4, 2026 17:22
Clickable reply-quote badge that scrolls to the referenced message with a
transient highlight effect.

- Add data-msg-id attribute to each message row
- Replace div.msg-reply-quote with button[data-reply-target] (no inline onclick)
- Add window.AcbScrollToMsg + event delegation on #messages
- Add CSS reset for button.msg-reply-quote + .msg-jump-highlight outline
…t-area in shared-chat.js selectThread, revert one-shot flag (aria-expanded guard is sufficient)
- Auto-register a browser-session agent (sessionStorage) to obtain
  X-Agent-Token required by POST /api/threads
- Pass creator_agent_id + X-Agent-Token header when creating thread
- Fix shared-api.js headers merge (spread was overwriting Content-Type)
- Disable Create button when topic is empty; re-enable on input
- Add .btn-primary:disabled CSS style
…valents

In JS comments and string literals, replace:
- U+2014 em dash with ASCII '--'
- U+2026 ellipsis with HTML entity &#8230;

Prevents double-encoding issues consistent with project conventions (PR Killea#38).
@Killea Killea merged commit f28e7b3 into Killea:main Mar 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants