feat(chat): structured context attachments with metadata round-trip

Every user-attached context item (diff/file/plan comments, terminal
selections, browser annotations, PR comments and failed checks, linked
issues/PRs, and new chat-quote comments from the selection menu) is now
sent as its own synthetic text part carrying an openchamberContext
metadata payload. The model-facing text keeps the previous wording; the
timeline reads the metadata back and renders each item as a context card
instead of raw prompt text. Legacy messages still render via the old
text sniffing.

The selection menu gains a Comment option with an inline multiline
input, the quoted fragment stays highlighted while commenting, and on
mobile the input overlays the composer pill by rendering inside the
composer form. Add to chat is renamed Add to input; the menu is
restyled and the mobile Copy tile removed. Terminal drafts move their
terminal id out of the language field (persisted-draft migration v3),
and the dead preview-console source is deleted.
This commit is contained in:
Bohdan Triapitsyn
2026-08-23 23:40:32 +03:00
parent 1af8b14bbb
commit 1ae3aeff5f
37 changed files with 1440 additions and 318 deletions
+12
View File
@@ -85,6 +85,18 @@ button,
background: color-mix(in srgb, var(--primary-base) 22%, transparent);
}
/* Quoted chat fragment kept visibly highlighted while its comment input is
open (the native selection collapses once the input takes focus). The
rectangles come from the selection's own client rects, so shape and shade
both match the native selection that was just showing. */
.oc-chat-comment-rect {
background-color: var(--interactive-selection);
}
:root.light .oc-chat-comment-rect {
background-color: color-mix(in srgb, var(--interactive-border-focus) 18%, transparent);
}
.pierre-diff-wrapper {
--diffs-bg-selection-override: color-mix(in srgb, var(--primary-base) 22%, transparent);
--diffs-bg-selection-background-override: color-mix(in srgb, var(--primary-base) 14%, transparent);