Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(gates): a tip is data-tip, never the operating system's title

esenginea05ea26a3ec2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 946672ba4..9f7d3cd0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ published separately; it ships inside the editor.
### Added
+- **The editor's tooltips are its own.** Every hover hint in the editor was the operating system's: it ignored the editor's theme and zoom, took its own time to appear, and from a popped-out panel was placed against the main window. All 320 are now drawn by the editor — the same card the content browser's asset tips use, under the control, after the same delay, at once when the control is reached by keyboard, and gone the moment you press it. Icon-only buttons keep the name a screen reader announces, which that hint used to supply.
+
- **Every screenshot in the agent's transcript says where it went.** The transcript showed each frame the agent captured, which read as each frame the model saw — including the ones held back from an endpoint that takes no images, and the ones not resent because nothing had changed. A line under each frame now gives its size and what it costs in tokens, then whether it went out with the next request, was held back and why, or was taken by the endpoint once that request came back. Taken means the endpoint accepted it, not that the model read it right.
- **An agent told its screenshot was too big hears that, not "the request was refused".** Every refusal read the same, so a turn that failed because the picture was too large for the endpoint was indistinguishable from one that failed on a bad tool argument — and it burned its retries on bytes that would be refused again. Too-large now says to capture a smaller region, and a refusal the endpoint itself blamed on an image says so and quotes it.
diff --git a/desktop b/desktop
index 61fbfe313..9bb5a4d3e 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 61fbfe313b07ad19de450f922151c5f0124ab0d6
+Subproject commit 9bb5a4d3e1bbd491e21a08e8484f4211dd6195dc
diff --git a/tools/baselines/theme-drift.json b/tools/baselines/theme-drift.json
index c1c1ebe62..07c7bca70 100644
--- a/tools/baselines/theme-drift.json
+++ b/tools/baselines/theme-drift.json
@@ -94,77 +94,69 @@
]
},
"handRolled": {
- "ai/ParamControls.tsx": 1,
"components/AddComponentMenu.tsx": 1,
- "components/AgentCheckpoint.tsx": 3,
- "components/AgentDrawer.tsx": 57,
- "components/AudioWavePreview.tsx": 3,
- "components/BuildDialog.tsx": 17,
- "components/BuildSizePanel.tsx": 3,
- "components/Button.tsx": 2,
+ "components/AgentCheckpoint.tsx": 2,
+ "components/AgentDrawer.tsx": 39,
+ "components/AudioWavePreview.tsx": 1,
+ "components/BuildDialog.tsx": 6,
+ "components/BuildSizePanel.tsx": 1,
+ "components/Button.tsx": 1,
"components/ColorControl.tsx": 1,
"components/CreatePopover.tsx": 1,
- "components/DirtyDot.tsx": 1,
"components/ErrorBoundary.tsx": 1,
"components/FindingLocations.tsx": 2,
"components/FindUsagesDialog.tsx": 1,
- "components/IconButton.tsx": 2,
- "components/MarkdownView.tsx": 3,
+ "components/IconButton.tsx": 1,
+ "components/MarkdownView.tsx": 2,
"components/Menu.tsx": 3,
- "components/NewPluginDialog.tsx": 1,
- "components/NodeGraphCanvas.tsx": 2,
- "components/OverlayMenu.tsx": 3,
+ "components/OverlayMenu.tsx": 1,
"components/QuickOpen.tsx": 3,
- "components/SaveButton.tsx": 2,
- "components/Segmented.tsx": 2,
+ "components/SaveButton.tsx": 1,
+ "components/Segmented.tsx": 1,
"components/Select.tsx": 2,
"components/SettingsDialog.tsx": 2,
- "components/SettingsRow.tsx": 11,
+ "components/SettingsRow.tsx": 5,
"components/SuggestInput.tsx": 1,
"components/TilemapPickerDialog.tsx": 1,
"components/Toaster.tsx": 2,
- "components/Transport.tsx": 2,
- "events/EventBindingSection.tsx": 8,
- "launcher/Launcher.tsx": 15,
- "layout/ActivityBar.tsx": 2,
- "layout/ContentDrawer.tsx": 2,
- "layout/DockLayout.tsx": 6,
+ "components/Transport.tsx": 1,
+ "events/EventBindingSection.tsx": 3,
+ "launcher/Launcher.tsx": 10,
+ "layout/ActivityBar.tsx": 1,
+ "layout/ContentDrawer.tsx": 1,
+ "layout/DockLayout.tsx": 3,
"layout/MenuBar.tsx": 1,
- "layout/StatusBar.tsx": 13,
- "layout/SubsystemIndicator.tsx": 2,
- "layout/Toolbar.tsx": 12,
- "layout/WindowControls.tsx": 6,
- "outliner/columns.tsx": 2,
- "outliner/OutlinerRow.tsx": 1,
- "panels/AnimatorEditor.tsx": 48,
- "panels/BtTreeEditor.tsx": 5,
- "panels/CollisionBrushPalette.tsx": 2,
- "panels/ContentBrowser.tsx": 18,
- "panels/ControllersPanel.tsx": 17,
- "panels/Details.tsx": 62,
- "panels/FlipbookEditor.tsx": 18,
- "panels/HealthPanel.tsx": 2,
- "panels/HistoryPanel.tsx": 7,
- "panels/inspector/componentDecorators.tsx": 24,
- "panels/inspector/controls.tsx": 42,
+ "layout/StatusBar.tsx": 4,
+ "layout/SubsystemIndicator.tsx": 1,
+ "layout/Toolbar.tsx": 6,
+ "layout/WindowControls.tsx": 3,
+ "panels/AnimatorEditor.tsx": 20,
+ "panels/BtTreeEditor.tsx": 3,
+ "panels/CollisionBrushPalette.tsx": 1,
+ "panels/ContentBrowser.tsx": 8,
+ "panels/ControllersPanel.tsx": 7,
+ "panels/Details.tsx": 30,
+ "panels/FlipbookEditor.tsx": 4,
+ "panels/HealthPanel.tsx": 1,
+ "panels/HistoryPanel.tsx": 5,
+ "panels/inspector/componentDecorators.tsx": 12,
+ "panels/inspector/controls.tsx": 26,
"panels/LightingPanel.tsx": 2,
- "panels/MaterialGraphEditor.tsx": 4,
- "panels/Outliner.tsx": 2,
+ "panels/MaterialGraphEditor.tsx": 2,
+ "panels/Outliner.tsx": 1,
"panels/OutputLog.tsx": 4,
- "panels/PluginsPanel.tsx": 2,
- "panels/ProfilerPanel.tsx": 17,
+ "panels/PluginsPanel.tsx": 1,
+ "panels/ProfilerPanel.tsx": 9,
"panels/ScatterPanel.tsx": 1,
- "panels/ScriptGraphEditor.tsx": 14,
- "panels/Sequencer.tsx": 18,
- "panels/SequencerCurve.tsx": 1,
- "panels/SpineDiagnosticsSection.tsx": 3,
+ "panels/ScriptGraphEditor.tsx": 7,
+ "panels/Sequencer.tsx": 12,
+ "panels/SpineDiagnosticsSection.tsx": 1,
"panels/SpinePreviewPane.tsx": 1,
- "panels/StateMachineEditor.tsx": 5,
- "panels/TilemapPainter.tsx": 26,
- "panels/TilesetEditor.tsx": 58,
- "panels/UIWidgetsPanel.tsx": 2,
- "panels/Viewport.tsx": 17,
- "panels/WorldPanel.tsx": 4,
- "tools/tileThumb.tsx": 1
+ "panels/StateMachineEditor.tsx": 2,
+ "panels/TilemapPainter.tsx": 12,
+ "panels/TilesetEditor.tsx": 26,
+ "panels/UIWidgetsPanel.tsx": 1,
+ "panels/Viewport.tsx": 6,
+ "panels/WorldPanel.tsx": 3
}
}
diff --git a/tools/check-theme.mjs b/tools/check-theme.mjs
index ed623b75d..3b33ba3fa 100644
--- a/tools/check-theme.mjs
+++ b/tools/check-theme.mjs
@@ -11,17 +11,16 @@
* labels in the editor — and a chart series ran on a 100%-saturated viewport
* colour.
*
- * Three claims are absolute: text stays readable on the surfaces it sits on, a
- * panel label stays quieter than the viewport, and a token that NAMES a thing
- * only colours that thing. That a token EXISTS at all is check-css-vars.mjs —
+ * Four claims are absolute: text stays readable on the surfaces it sits on, a
+ * panel label stays quieter than the viewport, a token that NAMES a thing only
+ * colours that thing, and a tip is the editor's rather than the OS's `title=`. That a token EXISTS at all is check-css-vars.mjs —
* its subject is every reader of the editor's variables, plugins and docs too.
*
* Six are RATCHETS, because each is hundreds of declarations deep and a gate
* that reddens on all of them gets switched off. Banked, may fall, never rise:
* spacing off the grid `--u` declares; colour literals where a token belongs; raw
- * font-size; how many distinct icon sizes and stroke widths exist at all — 14
- * and 16 today, including 1.8 / 1.85 / 1.9, which no one can tell apart; and
- * hand-rolled `<button>` and native `title=` where the editor has a component.
+ * font-size; how many distinct icon sizes and stroke widths exist at all; and
+ * hand-rolled `<button>` where the editor has a component.
*
* node tools/check-theme.mjs # check
* node tools/check-theme.mjs --update # bank the current state
@@ -366,11 +365,28 @@ const iconScale = () => {
};
/**
- * Controls the editor hand-rolled rather than took from `<Button>`/`<Tooltip>`,
- * which are outnumbered 336:28 and 311:3.
- *
- * A ratchet, not a rule: a raw `<button>` in a tile cell is right. `title=`
- * counts on DOM elements only — 80 of RM-092's 419 were `<Modal title=…>`.
+ * A DOM element's `title=` is the operating system's tooltip: unthemed, unzoomed,
+ * and drawn in the wrong window from a popout. The editor's is `data-tip`
+ * (TipLayer), plus an `aria-label` where the tip was the control's only name.
+ * An iframe's title is its accessible name, not a tip.
+ */
+const nativeTitles = () => {
+ const out = [];
+ for (const file of everyFile(SRC_DIR)) {
+ if (!file.endsWith('.tsx')) continue;
+ const text = readFileSync(file, 'utf8');
+ for (const m of text.matchAll(/<([a-z][a-z0-9]*)\b([^<]*?)\/?>/gs)) {
+ if (m[1] === 'iframe' || !/(?<![\w-])title=/.test(m[2])) continue;
+ const line = text.slice(0, m.index).split('\n').length;
+ out.push(`desktop/src/${path.relative(SRC_DIR, file).replaceAll(path.sep, '/')}:${line}`);
+ }
+ }
+ return out;
+};
+
+/**
+ * Buttons the editor hand-rolled rather than took from `<Button>`/`<IconButton>`.
+ * A ratchet, not a rule: a raw `<button>` in a tile cell is right.
*/
const handRolledByFile = () => {
const out = {};
@@ -381,12 +397,7 @@ const handRolledByFile = () => {
if (!/\.tsx$/.test(e.name)) continue;
const text = readFileSync(full, 'utf8');
const rel = path.relative(path.join(ROOT, 'desktop', 'src'), full).replaceAll(path.sep, '/');
- let n = [...text.matchAll(/<button\b/g)].length;
- // Attributes may span lines; stopping at the next `<` keeps an unclosed
- // tag from swallowing the rest of the file.
- for (const m of text.matchAll(/<([A-Za-z][A-Za-z0-9]*)\b([^<]*?)\/?>/gs)) {
- if (/^[a-z]/.test(m[1]) && /\btitle=/.test(m[2])) n += 1;
- }
+ const n = [...text.matchAll(/<button\b/g)].length;
if (n > 0) out[rel] = n;
}
};
@@ -439,6 +450,10 @@ const colourCode = colourLiteralInCodeByFile();
const fontSizes = rawFontSizeByFile();
const icons = iconScale();
const handRolled = handRolledByFile();
+for (const site of nativeTitles()) {
+ problems.push(`${site}: title= is the operating system's tooltip — use data-tip, `
+ + 'and aria-label where it was the control\'s only name');
+}
const total = Object.values(current).reduce((a, b) => a + b, 0);
const byName = (o) => Object.fromEntries(Object.entries(o).sort(([a], [b]) => a.localeCompare(b)));
@@ -486,7 +501,7 @@ if (!existsSync(BASELINE)) {
'colour literal(s) in code — read the token, do not restate it', 'desktop/src/');
ratchet(fontSizes, banked.rawFontSize, 'raw font-size(s) — use a step of the scale');
ratchet(handRolled, banked.handRolled,
- 'hand-rolled <button>/title= — the editor has <Button>/<Tooltip>', 'desktop/src/');
+ 'hand-rolled <button> — the editor has <Button>/<IconButton>', 'desktop/src/');
// Not per file: a new icon size anywhere is one more size the editor has.
for (const [kind, now] of [['size', icons.sizes], ['stroke width', icons.strokes]]) {
const was = new Set(kind === 'size' ? banked.iconScale?.sizes ?? [] : banked.iconScale?.strokes ?? []);