Skip to content

feat(TH-3859): minimize and restore docs AI chat - #889

Open
nik13 wants to merge 3 commits into
mainfrom
th-3859-docs-chat-minimize
Open

nik13 wants to merge 3 commits into
mainfrom
th-3859-docs-chat-minimize

Conversation

@nik13

@nik13 nik13 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a distinct Minimize control and a Restore AI chat chip on the docs assistant.
  • Close still dismisses the panel and keeps conversation history. New chat still resets (and clears the draft).
  • An unsent draft is stored in the tab session when the chat is minimized and comes back with the panel.
  • Minimize records the window mode before teardown, so a docked chat restores docked and fullscreen restores fullscreen.
  • Escape while focus is inside the chat minimizes it (park-and-return), with the same mode memory; in fullscreen, Escape first leaves fullscreen as before. Escape with focus elsewhere on the page no longer closes the chat. Close remains the dismiss button.

Test plan

  • PR check "Link audit & redirect enforcement" passed on bee342d; local audit-links (0 broken) and check-deleted-pages.mjs main (none deleted) pass on the current head
  • Local astro build on the current head: 1181 pages, exit 0. The two route-conflict warnings (/docs/sdk/tracing, /docs/sdk/annotation-queues) also appear on unrelated branches off the same main.
  • Built-site preview driven with Playwright (1440x900, chat API stubbed, no real prompt sent), on the current head:
    • Dock, Minimize, Restore: comes back docked (main margin 420px)
    • Dock, Escape inside the chat, Restore: comes back docked (failed on bee342d: came back as a popup)
    • Popup, Escape, Restore: comes back as a popup; Escape with focus outside the chat leaves it open
    • Draft typed, Minimize, navigate to another page: chip shown, Restore returns the draft; Close hides the chip
    • Question sent, navigate while the answer is still streaming: the input is empty (failed on bee342d: the sent question reappeared as the draft)
  • Independent review on 4c42a7a found the mode-capture bug, fixed in bee342d; adversarial verification passed bee342d. The two follow-up fixes in d792ac3 were found and checked in the merge-readiness pass above.

Not covered: streaming against the real docs agent, a real phone keyboard, and screen-reader checks. No backend, telemetry, or entitlement change.

Video demo

Recorded at bee342d, before the two fixes in d792ac3 (Escape-while-docked restore and the sent-text draft). Local preview of the built site, no prompt sent. Chapters and the private MP4 are on TH-3859.

nik13 and others added 3 commits October 3, 2026 20:04
Close still dismisses the panel and keeps history. Minimize parks the
same conversation behind a Restore chip, remembers the window mode, and
keeps the unsent draft in the tab session.
Snapshot the live window mode before exitSidebar/exitFullscreen rewrite
storage to popup. Drop the unused restore-status span.
… draft

Escape while the docked chat had focus undocked it before minimize() could
record the mode, so Restore came back as a popup. minimize() already undocks
after recording the mode; the extra exitSidebar() call is removed.

doSendMessage() saved state before clearing the input, so the question just
sent was stored as the unsent draft and reappeared in the input after a page
navigation while the answer was still streaming. Clear first, then save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nik13
nik13 requested a review from khushalsonawat October 7, 2026 09:20

This branch has not been deployed

No deployments
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.

1 participant