Refactoring round 5 covers the code since round 4 without changing behaviour: four identical copies of dot() and three of "nearest point on a segment" stood in the collision math, in the hit area of the collider outlines and in the polygon handles, so they moved into the new module src/core/util/vec.ts; the warning line, the busy state, info() and the caret reset were written out line by line in both the sign-in screen and the password dialog and are now FormStatus; the closing row "Cancel plus a confirming button, optionally one on the left" was built by hand in FormDialog, FilePicker, OpenProjectDialog and PasswordDialog and is now dialogButtons(); the header bar was drawn by the toolbar, the TabHeader and the Breadcrumb each on its own and is now drawHeaderBar(); AddColliderCommand and AddRigidbodyCommand share a base, each subclass only builds its own asset; Editor.ts derives the panes from assetEditors instead of repeating eight entries and clamps its splitters with clamp(); jscpd over src falls from 0.19 % to 0.14 %; dead code is gone - listScenes() has been orphaned since the Scene picker fell away (#183), DEFAULT_FILTER (#152) was never used, the two test hooks projectPickerRowAt/rowPosition and particleCompiles are read by no tool, and four functions lost an export they did not need; seven comments that told history ("used to", "no longer", "since #...") describe the state of things now, and that this changed nothing was proved by a rebuild - the bundle is md5 identical, b4ad0dfe... before and after; the README said Logout sits at the far right of the toolbar, which has been the Account menu since #182, and wiki/Architecture.md was missing src/core/util/ altogether; 4 new unit tests cover vec.ts, and switching the clamp on the segment off makes exactly one of them fail while none of the 76 neighbouring tests notice, so that clamping was covered nowhere before (#85)
game-maker / gate (push) Successful in 2m0s
game-maker / suite (push) Successful in 7m17s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-20 17:24:42 +02:00
1 parent da35f10d1a
commit ae3aa7d3bd
32 files changed
+240 -246

No files matched your search

+8 -10
View File
@@ -1,5 +1,5 @@
import { Graphics } from 'pixi.js';
import { Button, Dropdown, HStack, Label, Spacer, Theme, type Widget } from '../../ui';
import { Button, drawHeaderBar, Dropdown, HStack, Label, Spacer, Theme, type Widget } from '../../ui';
import type { EditorState, SaveStatus } from '../state';
import { TOOLBAR_ICON_SVG } from './toolbarIcons';
@@ -38,9 +38,9 @@ function iconButton(name: IconName, onClick: () => void): Button {
/**
* Top bar (#183): menu, undo and redo on the left, play and pause in the middle, the account on
* the right – icons, no captions. What it used to spell out lives in the menu now: the project
* name and the start-scene switch in Project settings, the project list in Open project, and the
* scene is picked where the scenes are, in the Assets panel.
* the right – icons, no captions. Everything with words is behind the menu: the project name and
* the start-scene switch in Project settings, the project list in Open project. The scene is
* picked where the scenes are, in the Assets panel.
*/
export class Toolbar extends HStack {
private readonly bg = new Graphics();
@@ -80,8 +80,8 @@ export class Toolbar extends HStack {
this.add(this.pauseButton);
this.add(new Spacer(), 1);
// Flexible, not a fixed strip: it is the one thing here that may shrink, and since the account
// button (#177) the row no longer fits a narrow window otherwise.
// Flexible, not a fixed strip: it is the one thing here that may shrink, and with the account
// button (#177) the row does not fit a narrow window otherwise.
this.notice = new Label('', { style: 'small', align: 'right' });
this.add(this.notice, 1);
this.status = new Label('', { style: 'small', align: 'right' });
@@ -113,7 +113,7 @@ export class Toolbar extends HStack {
};
}
/** The five icon buttons, so a check can click what no longer carries a caption. */
/** The five icon buttons, so a check can click what carries no caption. */
get controls(): Record<'menu' | 'undo' | 'redo' | 'play' | 'pause', Button> {
return {
menu: this.menuButton,
@@ -167,8 +167,6 @@ export class Toolbar extends HStack {
}
override redraw(): void {
this.bg.clear();
this.bg.rect(0, 0, this.w, this.h).fill(Theme.colors.panelHeader);
this.bg.rect(0, this.h - 1, this.w, 1).fill(Theme.colors.border);
drawHeaderBar(this.bg, this.w, this.h);
}
}