Shell: tooltips at once, one or two words; text-size buttons are drawn − and +
Every header and top-bar button's title becomes a tip the shell shows the moment the pointer arrives (the browser's own waits a second and looks different everywhere); it moves from `title` to data-tip so the native one never appears, and a module that sets `title` again is picked up on the next hover. The shell's own labels are "Settings" and "Remove"; the top bar's are "Fullscreen", "Add tile", "Layouts", "Admin"; Slack, PCO Plan, ProdCom and Timers shorten theirs to match. A− / A+ are a drawn − and + in Slack, PCO Plan and ProdCom, sized like every other header icon. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
1930fb142d
commit
818def822d
@@ -330,16 +330,17 @@ bar, next to the shell's gear/close buttons:
|
||||
|
||||
```js
|
||||
const btn = moduleApi.header.addButton({
|
||||
icon: '<svg …>…</svg>', // inline SVG string, and/or
|
||||
label: 'A+', // short text
|
||||
title: 'Larger text', // hover tooltip
|
||||
icon: '<svg …>…</svg>', // inline SVG string (13 px), and/or
|
||||
label: 'Timers ▾', // short text
|
||||
title: 'Larger text', // tooltip — one or two words; the shell shows
|
||||
// it the moment the pointer arrives
|
||||
onClick() { … },
|
||||
});
|
||||
btn.classList.add('active'); // toggle styling for on/off buttons
|
||||
|
||||
const menu = moduleApi.header.addMenu({
|
||||
label: 'Channels ▾',
|
||||
title: 'Choose visible channels',
|
||||
title: 'Channels',
|
||||
build(menuEl) {
|
||||
// called on every open with an emptied menu element — fill it with
|
||||
// buttons (give them your scoped classes; the container is styled and
|
||||
@@ -351,7 +352,10 @@ menu.setLabel('Channels (2/4) ▾'); // update the button text any time
|
||||
|
||||
Everything you add is removed automatically when your instance stops, so a
|
||||
remount never duplicates controls. Keep them compact (icon buttons, short
|
||||
labels): the title bar is 32 px tall and shared with the tile's name.
|
||||
labels): the title bar is 32 px tall and shared with the tile's name. Draw
|
||||
icons as inline SVG rather than characters — a glyph such as ✕ or + takes
|
||||
its size from whatever font each browser picks; text-size buttons are a
|
||||
drawn − and +.
|
||||
|
||||
**One control per action.** Whatever has a dedicated header button is not
|
||||
offered again in the gear popover: text size is A− / A+ up here (persisted
|
||||
|
||||
Reference in New Issue
Block a user