Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Theme tooltips and position sidebar status outside the rail (#1579)

Regan Belld36ff44a84c9
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index c2735e007..8910c2dde 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -86,6 +86,7 @@ body {
}
.sidebar {
+ anchor-name: --qm-sidebar;
width: var(--sidebar-w);
flex-shrink: 0;
box-sizing: border-box;
@@ -9026,7 +9027,7 @@ h3.ambient-field-label {
}
.qm-tooltip {
- border: 0;
+ border: 1px solid var(--border);
position: fixed;
position-anchor: --qm-tooltip-anchor;
position-area: top span-all;
@@ -9042,8 +9043,9 @@ h3.ambient-field-label {
border-radius: 6px;
font-size: 11.5px;
line-height: 1.35;
- color: var(--background, #fff);
- background: color-mix(in srgb, var(--foreground) 92%, transparent);
+ color: var(--foreground);
+ background: var(--popover);
+ box-shadow: var(--chat-surface-shadow);
pointer-events: none;
display: none;
overflow-wrap: anywhere;
@@ -9057,12 +9059,25 @@ h3.ambient-field-label {
align-self: anchor-center;
position-try-fallbacks: --qm-tooltip-above, --qm-tooltip-below;
}
+.qm-tooltip.sidebar-status {
+ position-area: right span-all;
+ left: anchor(--qm-sidebar right);
+ justify-self: normal;
+ align-self: anchor-center;
+ margin: 8px;
+ padding: 8px 10px;
+ border-radius: var(--radius-sm);
+ line-height: 1.5;
+ position-try-fallbacks: --qm-tooltip-above, --qm-tooltip-below;
+}
@position-try --qm-tooltip-above {
+ left: auto;
position-area: top span-all;
justify-self: anchor-center;
align-self: normal;
}
@position-try --qm-tooltip-below {
+ left: auto;
position-area: bottom span-all;
justify-self: anchor-center;
align-self: normal;
diff --git a/plugins/web-ui/src/tooltip.ts b/plugins/web-ui/src/tooltip.ts
index ea8681b8f..393131ae0 100644
--- a/plugins/web-ui/src/tooltip.ts
+++ b/plugins/web-ui/src/tooltip.ts
@@ -26,6 +26,7 @@ function showTooltip(target: Element, text: string): void {
target.setAttribute("data-qm-tooltip-anchor", "");
const el = ensureEl();
el.textContent = text;
+ el.classList.toggle("sidebar-status", target.matches(".sidebar .session-status"));
el.classList.toggle("beside", !!target.closest('[data-tip-placement="right"]'));
el.classList.add("visible");
el.showPopover?.();
diff --git a/plugins/web-ui/test/css-vars.test.ts b/plugins/web-ui/test/css-vars.test.ts
index ff93b2685..18999117a 100644
--- a/plugins/web-ui/test/css-vars.test.ts
+++ b/plugins/web-ui/test/css-vars.test.ts
@@ -136,8 +136,9 @@ test("chat shadows stay limited to elevated surfaces and subtle activity hover g
"0 0 12px color-mix(in srgb, var(--foreground) 12%, transparent)",
],
[".composer-wrap", "box", "0 2px 5px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.06)"],
+ [".qm-tooltip", "box", "var(--chat-surface-shadow)"],
],
- "pinned surfaces and the composer retain their shadows; activity glow appears only on hover",
+ "pinned surfaces, the composer, and tooltips retain their shadows; activity glow appears only on hover",
);
const inlineShadows = [...tsSource.matchAll(/(?:box|text)-shadow\s*:\s*([^;}]+)/g)]
.map((m) => m[1].trim())