UI: Tooltips für Knöpfe ohne Beschriftung #209

Closed
opened 2026-09-23 07:05:34 +02:00 by meleki · 2 comments
Owner

Aus #183 („Es gibt keine Tooltips im Toolkit … dafür gehört ein eigenes Issue angelegt“). Dieselbe Lücke hat bei #195 eine Entscheidung erzwungen: Das Menü für den Punkttyp zeigt „Point: …“ als Text statt vier Icons, „weil das UI-Toolkit keine Tooltips kennt“.

Befund

  • Das Widget-Toolkit (src/ui/widgets/) kennt keinen Hinweistext beim Überfahren. Button hat seit #176 eine icon-Option, aber nichts, was erklärt, was der Knopf tut.
  • Seit #183 trägt die Toolbar (src/editor/panels/Toolbar.ts) fünf reine Icon-Knöpfe: Menü, Undo, Redo, Play, Pause. Dazu kommen der Magnet (src/editor/graph/SnapToggle.ts, #194), die Tab-Icons (#176) und die Werkzeuge im Pixel-Art-Tab.
  • Wer ein Icon nicht erkennt, kann es heute nur ausprobieren.

Zu bauen (Vorschlag)

  • Eine Option tooltip: string an Button (und an allem, was davon erbt). Nach etwa 500 ms Stillstand über dem Knopf erscheint ein kleines Schild mit dem Text, ein Wegbewegen oder Drücken schließt es.
  • Ein Tooltip-Layer über allem (wie die Menüs), nicht eines pro Widget. Er bleibt im Fenster: Am rechten oder unteren Rand klappt er nach links bzw. oben.
  • Die Regel für die Position als reine Funktion (Anker, Schildgröße, Fenster → Position), ohne Browser testbar.
  • Belegt werden alle Icon-Knöpfe ohne Text. Bei Undo und Redo gehört der Name des Schritts dazu („Undo Paint tiles“).
  • Tests: Unit für die Position, e2e mit echtem Hover über einem Toolbar-Knopf (Schild erscheint, Text stimmt, verschwindet beim Wegbewegen).

Offen (mit Vorschlag)

  1. Auch für Tabs mit gekürztem Namen (… ab 160 px, #171)? Vorschlag: ja, dort zeigt der Tooltip den vollen Namen.
  2. Tastenkürzel im Tooltip („Undo (Ctrl+Z)“)? Vorschlag: ja, wo es eines gibt.
  3. Danach das Punkt-Menü aus #195 auf Icons umstellen? Vorschlag: nein, nicht in diesem Issue.
Aus #183 („Es gibt keine Tooltips im Toolkit … dafür gehört ein eigenes Issue angelegt“). Dieselbe Lücke hat bei #195 eine Entscheidung erzwungen: Das Menü für den Punkttyp zeigt „Point: …“ als Text statt vier Icons, „weil das UI-Toolkit keine Tooltips kennt“. ## Befund - Das Widget-Toolkit (`src/ui/widgets/`) kennt keinen Hinweistext beim Überfahren. `Button` hat seit #176 eine `icon`-Option, aber nichts, was erklärt, was der Knopf tut. - Seit #183 trägt die Toolbar (`src/editor/panels/Toolbar.ts`) fünf reine Icon-Knöpfe: Menü, Undo, Redo, Play, Pause. Dazu kommen der Magnet (`src/editor/graph/SnapToggle.ts`, #194), die Tab-Icons (#176) und die Werkzeuge im Pixel-Art-Tab. - Wer ein Icon nicht erkennt, kann es heute nur ausprobieren. ## Zu bauen (Vorschlag) - Eine Option `tooltip: string` an `Button` (und an allem, was davon erbt). Nach etwa 500 ms Stillstand über dem Knopf erscheint ein kleines Schild mit dem Text, ein Wegbewegen oder Drücken schließt es. - **Ein** Tooltip-Layer über allem (wie die Menüs), nicht eines pro Widget. Er bleibt im Fenster: Am rechten oder unteren Rand klappt er nach links bzw. oben. - Die Regel für die Position als reine Funktion (Anker, Schildgröße, Fenster → Position), ohne Browser testbar. - Belegt werden alle Icon-Knöpfe ohne Text. Bei Undo und Redo gehört der Name des Schritts dazu („Undo Paint tiles“). - Tests: Unit für die Position, e2e mit echtem Hover über einem Toolbar-Knopf (Schild erscheint, Text stimmt, verschwindet beim Wegbewegen). ## Offen (mit Vorschlag) 1. **Auch für Tabs mit gekürztem Namen** (`…` ab 160 px, #171)? Vorschlag: ja, dort zeigt der Tooltip den vollen Namen. 2. **Tastenkürzel im Tooltip** („Undo (Ctrl+Z)“)? Vorschlag: ja, wo es eines gibt. 3. **Danach das Punkt-Menü aus #195 auf Icons umstellen?** Vorschlag: nein, nicht in diesem Issue.
meleki added the new label 2026-09-23 07:05:34 +02:00
admin added low-priorityquestion and removed new labels 2026-09-23 07:06:21 +02:00
admin added this to the Development project 2026-09-23 07:14:42 +02:00
admin moved this to Next in Development on 2026-10-02 10:34:29 +02:00

vorschläge passen, zu 3.: auch kein folge-issue, ich erwähne es, wenn es benötigt wird

vorschläge passen, zu 3.: auch kein folge-issue, ich erwähne es, wenn es benötigt wird
admin removed the question label 2026-10-02 10:36:07 +02:00
admin moved this to Done in Development on 2026-10-02 12:00:52 +02:00
Author
Owner

Done in ec2fd90, wiki 82a952c (Architecture, Concepts, Development).

What changes
Following the answer above: the proposals stand, a cut tab name shows in full, shortcuts are part of the text, the point menu of #195 stays words and gets no follow-up issue.

  • A tooltip. Rest the pointer for half a second on a button without a caption and a small sign says what the button does. Moving away, a click, a key or the wheel takes it away again.
  • Its place. The sign sits under the button, flush with its left edge. At the right border of the window it turns to the left, at the bottom it goes above the button.
  • Top bar. Menu, Undo ... (Ctrl+Z), Redo ... (Ctrl+Y), Play (Ctrl+Enter) or Stop (Esc), Pause or Resume (Ctrl+Enter). Undo and redo name the step, as in "Undo Paint tiles (Ctrl+Z)".
  • Tabs. A tab whose name was cut short shows the whole name.
  • Other buttons with a tooltip:
    • the magnet, fullscreen (game tab and the corner in the game), the eye of the scene tab, » of the tab strip, + of the assets panel
    • in the inspector: reset, apply and size from the picture, the pipette, the cross buttons, the two switches of a variable, the child mark, + and - of the grid edges
    • the nine anchors of the resize dialog of pixel art
    • in the layer lists: the eye, duplicate, the cross and the plus

Decided here

  • Every button whose text is cut short shows the whole text, not only a tab. A dropdown with a long asset name is one of them.
  • A row action of the inspector names the one thing a click does ("Reset to asset"). A button that opens a menu says only "Reset", "Apply" or "Size from the picture".
  • A button just clicked stays quiet until the pointer has left it.
  • A greyed out button shows no tooltip. An undo without a step or a play without a scene does not explain itself.
  • Without a tooltip: the switches of the eye popup (they have column heads), the cross of a document tab and the tools of pixel art. The tools carry words, other than this issue assumes.
  • The marks of the layer lists say the same in every list: Show or Hide, Duplicate, Remove, Add.

One finding

  • Solved: signing out empties the overlay and would have destroyed a sign on screen with it. The tooltip is taken away first. This place has no test of its own, e2e 45 (login) ran green.

Under the hood

  • src/ui/tooltip.ts is the rule as pure functions: placeTooltip (anchor, size of the sign, screen > position), withShortcut, and the wait TOOLTIP_DELAY_MS.
  • src/ui/widgets/Tooltip.ts holds the one sign of the page, tooltips (a TooltipLayer), on the overlay above the menus. A control calls point on each pointer move and leave when the pointer goes, the layer does the waiting. initUI listens on the window for a press, a key, the wheel and a blur and calls dismiss.
  • Button takes tooltip, a text or a function asked each time. tooltipText() falls back to the full label where that is cut short.
  • src/editor/panels/toolbarTips.ts (toolbarTip) says what the top bar buttons do right now, with CommandStack.undoLabel and redoLabel. rowActionTip in fieldFactory.ts does it for the row actions.
  • SortableList reports its own marks with a key per mark.
  • __gm.tooltip() reports the sign on screen with its box and the box of its control. The text hooks (locate, has) skip it.

Tests

gate (melektaus-atx)     210 files, 3209 tests, CHECK EXIT 0 (3176 + 33)
e2e 46                   ALL PASSED - 20 checks
e2e 1-14                 ALL PASSED - 508 checks
e2e 1-9,14,39,40,44-48   685 PASS, 2 FAILED
  • The two red checks are in module 14 (tab widths). It measures tabs that modules 10 to 13 open, and it was run without them. The whole chain 1-14 is green. The cut chain was not run on the state before this change.
  • No full run and no smokes. The sum of 1667 (1664 + 3) in README and wiki is reckoned. 1664 is what CI counted for 3452899 (run 241, read in the log). A run for ec2fd90 was started with the push and was not waited for.
  • 33 unit tests in tests/ui/tooltip.test.ts: the place, the wait, taking the sign away, the texts of the top bar, cut names, the marks of a list.
  • Three e2e checks with a real mouse in block 46h: the redo button after the wait, taking the sign away by leaving, the wheel and a click, turning at the right border.
  • Two screenshots looked at: the sign under the redo button, and the one turned to the left at a reset button of the inspector.
  • Not checked in the browser: the tooltip of a cut tab and those of the layer lists, turning upwards at the bottom (unit tests only), and each of the other buttons alone. Nothing was looked at after the build.
Counter-check Result
50 in the unit tests all work. Three did not at first, their tests are sharper now
4 in the browser all work, the build went through each time
Done in `ec2fd90`, wiki `82a952c` (*Architecture*, *Concepts*, *Development*). **What changes** Following the answer above: the proposals stand, a cut tab name shows in full, shortcuts are part of the text, the point menu of #195 stays words and gets no follow-up issue. - **A tooltip.** Rest the pointer for half a second on a button without a caption and a small sign says what the button does. Moving away, a click, a key or the wheel takes it away again. - **Its place.** The sign sits under the button, flush with its left edge. At the right border of the window it turns to the left, at the bottom it goes above the button. - **Top bar.** *Menu*, *Undo ... (Ctrl+Z)*, *Redo ... (Ctrl+Y)*, *Play (Ctrl+Enter)* or *Stop (Esc)*, *Pause* or *Resume (Ctrl+Enter)*. Undo and redo name the step, as in "Undo Paint tiles (Ctrl+Z)". - **Tabs.** A tab whose name was cut short shows the whole name. - **Other buttons with a tooltip:** - the magnet, fullscreen (game tab and the corner in the game), the eye of the scene tab, `»` of the tab strip, `+` of the assets panel - in the inspector: reset, apply and size from the picture, the pipette, the cross buttons, the two switches of a variable, the child mark, `+` and `-` of the grid edges - the nine anchors of the resize dialog of pixel art - in the layer lists: the eye, duplicate, the cross and the plus **Decided here** - **Every button whose text is cut short** shows the whole text, not only a tab. A dropdown with a long asset name is one of them. - **A row action of the inspector** names the one thing a click does ("Reset to asset"). A button that opens a menu says only "Reset", "Apply" or "Size from the picture". - **A button just clicked stays quiet** until the pointer has left it. - **A greyed out button shows no tooltip.** An undo without a step or a play without a scene does not explain itself. - **Without a tooltip:** the switches of the eye popup (they have column heads), the cross of a document tab and the tools of pixel art. The tools carry words, other than this issue assumes. - **The marks of the layer lists** say the same in every list: *Show* or *Hide*, *Duplicate*, *Remove*, *Add*. **One finding** - **Solved:** signing out empties the overlay and would have destroyed a sign on screen with it. The tooltip is taken away first. This place has no test of its own, e2e 45 (login) ran green. **Under the hood** - `src/ui/tooltip.ts` is the rule as pure functions: `placeTooltip` (anchor, size of the sign, screen > position), `withShortcut`, and the wait `TOOLTIP_DELAY_MS`. - `src/ui/widgets/Tooltip.ts` holds the one sign of the page, `tooltips` (a `TooltipLayer`), on the overlay above the menus. A control calls `point` on each pointer move and `leave` when the pointer goes, the layer does the waiting. `initUI` listens on the window for a press, a key, the wheel and a blur and calls `dismiss`. - `Button` takes `tooltip`, a text or a function asked each time. `tooltipText()` falls back to the full label where that is cut short. - `src/editor/panels/toolbarTips.ts` (`toolbarTip`) says what the top bar buttons do right now, with `CommandStack.undoLabel` and `redoLabel`. `rowActionTip` in `fieldFactory.ts` does it for the row actions. - `SortableList` reports its own marks with a key per mark. - `__gm.tooltip()` reports the sign on screen with its box and the box of its control. The text hooks (`locate`, `has`) skip it. **Tests** ``` gate (melektaus-atx) 210 files, 3209 tests, CHECK EXIT 0 (3176 + 33) e2e 46 ALL PASSED - 20 checks e2e 1-14 ALL PASSED - 508 checks e2e 1-9,14,39,40,44-48 685 PASS, 2 FAILED ``` - **The two red checks are in module 14** (tab widths). It measures tabs that modules 10 to 13 open, and it was run without them. The whole chain `1-14` is green. The cut chain was not run on the state before this change. - No full run and no smokes. The sum of 1667 (1664 + 3) in README and wiki is reckoned. 1664 is what CI counted for `3452899` (run 241, read in the log). A run for `ec2fd90` was started with the push and was not waited for. - 33 unit tests in `tests/ui/tooltip.test.ts`: the place, the wait, taking the sign away, the texts of the top bar, cut names, the marks of a list. - Three e2e checks with a real mouse in block 46h: the redo button after the wait, taking the sign away by leaving, the wheel and a click, turning at the right border. - Two screenshots looked at: the sign under the redo button, and the one turned to the left at a reset button of the inspector. - **Not checked in the browser:** the tooltip of a cut tab and those of the layer lists, turning upwards at the bottom (unit tests only), and each of the other buttons alone. Nothing was looked at after the build. | Counter-check | Result | |---|---| | 50 in the unit tests | all work. Three did not at first, their tests are sharper now | | 4 in the browser | all work, the build went through each time |
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#209