fix(view-context): a corner mark on the bubble, not a row under it
Nightly Build / build (push) Successful in 9s
Nightly Build / build (push) Successful in 9s
The sent-message proof was a collapsed <details> under the user bubble: a row of height in every bubble that carried view context, for something that is evidence about the message rather than part of it. It also rendered a blank line, since the bubble is white-space: pre-wrap and the template left a newline before the element. Now a faint eye in the bubble's bottom-right corner, revealing the pairs on hover (on focus for keyboard and touch). Deliberately not expandable, so scrolling back through a conversation cannot grow a second layout, and the popover opens downwards rather than over the message it belongs to. The i18n key stays alive as the mark's aria-label; docs and changelog wording updated to match.
This commit is contained in:
@@ -889,33 +889,72 @@
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
/* The chip inside a sent user bubble: collapsed by default, same muted weight as
|
||||
the reasoning block — it is evidence, not content. */
|
||||
.view-ctx-chip {
|
||||
margin-top: 0.4rem;
|
||||
font-size: 0.75rem;
|
||||
white-space: normal;
|
||||
/* The mark in a sent user bubble's corner: it is evidence about the message, not
|
||||
part of it, so it costs the bubble a corner rather than a row of its own. Kept
|
||||
faint on purpose — it should be findable when looked for and invisible when
|
||||
not. Hover (focus, on touch and for the keyboard) reveals the pairs; there is
|
||||
no expanded state, by design. */
|
||||
.copilot-msg.user.copilot-msg--view-ctx {
|
||||
position: relative;
|
||||
/* Room for the mark, so a last line can never run under it. */
|
||||
padding-bottom: 1.35rem;
|
||||
}
|
||||
|
||||
.view-ctx-chip > summary {
|
||||
.view-ctx-mark {
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
bottom: 0.25rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
padding: 0.2rem 0.45rem;
|
||||
border: 1px solid var(--toolbar-border);
|
||||
border-radius: 0.5rem;
|
||||
color: var(--placeholder-color);
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
line-height: 1.2;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1;
|
||||
color: inherit;
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
transition: opacity 0.12s;
|
||||
}
|
||||
|
||||
.view-ctx-chip > summary::-webkit-details-marker { display: none; }
|
||||
.view-ctx-chip > summary:hover { border-color: var(--accent); color: var(--accent); }
|
||||
.view-ctx-mark:hover,
|
||||
.view-ctx-mark:focus { opacity: 0.9; outline: none; }
|
||||
.view-ctx-mark:focus-visible { opacity: 0.9; outline: 2px solid currentColor; outline-offset: 2px; border-radius: 0.2rem; }
|
||||
|
||||
.view-ctx-chip .view-ctx-items {
|
||||
margin-top: 0.4rem;
|
||||
padding-left: 0.15rem;
|
||||
/* Below the bubble, right-aligned with it: above would cover the message the
|
||||
mark belongs to. */
|
||||
.view-ctx-pop {
|
||||
position: absolute;
|
||||
top: calc(100% + 6px);
|
||||
right: 0;
|
||||
z-index: 20;
|
||||
display: block;
|
||||
width: max-content;
|
||||
max-width: min(26rem, 70vw);
|
||||
max-height: 16rem;
|
||||
overflow-y: auto;
|
||||
padding: 0.5rem 0.65rem;
|
||||
border: 1px solid var(--toolbar-border);
|
||||
border-radius: 0.5rem;
|
||||
background: var(--msg-assistant-bg);
|
||||
color: var(--msg-assistant-text);
|
||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
|
||||
font-size: 0.75rem;
|
||||
/* The bubble is pre-wrap; the popover formats its own values. */
|
||||
white-space: normal;
|
||||
text-align: left;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.12s;
|
||||
}
|
||||
|
||||
/* Interactive only while shown: `:hover` applies to ancestors of the hovered
|
||||
element, so letting the pointer onto the popover keeps the mark hovered — which
|
||||
is what makes a long, scrollable value readable. Hidden, it must not eat a
|
||||
click on the bubble underneath. */
|
||||
.view-ctx-mark:hover .view-ctx-pop,
|
||||
.view-ctx-mark:focus .view-ctx-pop {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* ── Tool card "view details" (eye) ────────────────────────────────────────── */
|
||||
|
||||
Reference in New Issue
Block a user