Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

web-ui: hover popover labels the session top-bar icon buttons (#511)

Regan Bell6ee85e0637f5
diff --git a/plugins/web-ui/src/session-scope.ts b/plugins/web-ui/src/session-scope.ts
index d262e5c9a..1a6190c8f 100644
--- a/plugins/web-ui/src/session-scope.ts
+++ b/plugins/web-ui/src/session-scope.ts
@@ -139,10 +139,11 @@ export function sessionTopbarTpl(o: SessionTopbarOpts): TemplateResult {
<button
class="session-tool ${o.activeTool === t ? "active" : ""}"
type="button"
- title=${hint}
+ aria-label=${hint}
@click=${() => o.onTool(t)}
>
${icon(glyph, 15)}${count ? html`<span class="session-tool-count">${count}</span>` : nothing}
+ <span class="session-tool-hint" role="tooltip">${hint}</span>
</button>
`;
};
@@ -156,9 +157,9 @@ export function sessionTopbarTpl(o: SessionTopbarOpts): TemplateResult {
: html`<div class="session-heading" title=${headingTitle}>${heading}</div>`
}
<div class="topbar-actions session-tools">
- ${tool("crons", Clock3, "Crons in this context")} ${tool("files", Files, "Files in this context")}
- ${tool("apps", Rocket, "Apps in this context")} ${tool("skills", Box, "Skills in this context")}
- ${tool("memory", Brain, "Memory")} ${tool("keychain", KeyRound, "Your keychain")}
+ ${tool("crons", Clock3, "Crons")} ${tool("files", Files, "Files")} ${tool("apps", Rocket, "Apps")}
+ ${tool("skills", Box, "Skills")} ${tool("memory", Brain, "Memory")}
+ ${tool("keychain", KeyRound, "Your keychain")}
</div>
</header>
`;
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index 8f0fb15b9..1f31666f1 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -1158,6 +1158,34 @@ a.chat-row-open {
.session-tool:hover .session-tool-count {
color: var(--foreground);
}
+.session-tool {
+ position: relative;
+}
+.session-tool-hint {
+ position: absolute;
+ top: calc(100% + 6px);
+ right: 0;
+ z-index: 40;
+ padding: 4px 8px;
+ border-radius: 6px;
+ background: var(--foreground);
+ color: var(--background);
+ font-size: 11.5px;
+ font-weight: 550;
+ line-height: 1.3;
+ white-space: nowrap;
+ pointer-events: none;
+ opacity: 0;
+ transform: translateY(-2px);
+ transition:
+ opacity 120ms ease,
+ transform 120ms ease;
+}
+.session-tool:hover .session-tool-hint,
+.session-tool:focus-visible .session-tool-hint {
+ opacity: 1;
+ transform: translateY(0);
+}
.session-heading.as-link {
border: 0;
background: transparent;