The topbar is icons only: the leading Project dropdown, the Scene picker and the labelled Play/Pause buttons are gone and in their place stand five icon buttons - menu, undo, redo on the left, play and pause in the middle - while Notice, the save state, fps and the Account menu keep the right side; the Play button swaps its icon for a stop square while the project runs and Pause swaps for a second play sign while it is held (Button.setIcon()), and iconSpace() drops the gap between icon and label when a button has no label, which is what kept a 24 px icon button 3 px off its own centre; the menu carries New project, Open project..., a separator and Project settings..., where the picker (src/editor/OpenProjectDialog.ts) preselects the open project and marks it "open", opens on a double click and puts Delete on the left of Cancel and Open - it closes itself before it asks whether to delete, because two modals on top of each other would have left the question standing over a list it no longer speaks about - and the settings dialog (src/editor/ProjectSettingsDialog.ts) holds the name, the "Play starts" switch (Start scene / Active scene, a preference of this browser and so no command) and the collision layers from #152, which retires CollisionLayersDialog.ts and the "Collision layers..." entry; what Apply actually writes is the pure function settingsChanges(), so renaming and the layers are each their own undo step and each drop out when nothing differs; the Scene dropdown falls away without replacement, the active scene is switched by double clicking it in the Assets panel, which is the way that was there anyway; new module 46 runs last with 9 checks (no label left in the bar, the run buttons in edit mode, the four menu entries, the picker with the open project preselected, Cancel leaving the project standing, the settings dialog on the state of the project, renaming with undo and redo through the icon buttons) and it neither opens nor deletes a project, because that would pull the project out from under every earlier module; modules 8, 18 and 35 and the harness follow the new bar, 6 unit tests cover settingsChanges and 3 the icons (#183)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
defd4a86d2
commit
60d0146bde
24 files changed
+751
-284
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
LIST_ICON_SVG,
|
||||
PLUGINS_ICON_SVG,
|
||||
} from '../../src/editor/panels/assetIcons';
|
||||
import { TOOLBAR_ICON_SVG } from '../../src/editor/panels/toolbarIcons';
|
||||
import { tintSvg } from '../../src/ui/svg';
|
||||
import { SYMBOL_SVG } from '../../src/viewport/symbolIcons';
|
||||
|
||||
@@ -39,8 +40,30 @@ describe('icon files', () => {
|
||||
['list tab', LIST_ICON_SVG],
|
||||
['game tab', GAME_ICON_SVG],
|
||||
['plugins tab', PLUGINS_ICON_SVG],
|
||||
...Object.entries(TOOLBAR_ICON_SVG).map(([name, svg]) => [`toolbar ${name}`, svg]),
|
||||
];
|
||||
|
||||
it('has one icon per button of the top bar, each its own picture (#183)', () => {
|
||||
expect(Object.keys(TOOLBAR_ICON_SVG).sort()).toEqual(['menu', 'pause', 'play', 'redo', 'stop', 'undo']);
|
||||
expect(new Set(Object.values(TOOLBAR_ICON_SVG)).size).toBe(6);
|
||||
});
|
||||
|
||||
// The bar carries no captions any more, so a picture shared with a tab or an asset type would be
|
||||
// the only thing left telling the two apart – and it would not.
|
||||
it('draws the top bar in pictures of its own, none of them an asset icon (#183)', () => {
|
||||
const others = [...Object.values(ASSET_ICON_SVG), LIST_ICON_SVG, GAME_ICON_SVG, PLUGINS_ICON_SVG];
|
||||
for (const svg of Object.values(TOOLBAR_ICON_SVG)) expect(others).not.toContain(svg);
|
||||
});
|
||||
|
||||
// Pixi's parser draws an A in the middle of a path as a spike (the puzzle piece of #119); undo
|
||||
// and redo are the arcs of this set, so they are the ones that have to keep clear of it.
|
||||
it('bends the top bar arrows with cubic curves rather than arcs (#183)', () => {
|
||||
for (const svg of [TOOLBAR_ICON_SVG.undo, TOOLBAR_ICON_SVG.redo]) {
|
||||
expect(svg).toContain('C');
|
||||
for (const { attrs } of tags(svg).slice(1)) expect(attrs.d ?? '').not.toMatch(/[Aa]/);
|
||||
}
|
||||
});
|
||||
|
||||
// Pixi draws the file's coordinates as they are and ignores the viewBox, so the viewBox only
|
||||
// shows the file right elsewhere – centred on the origin, it matches what the editor draws.
|
||||
it.each(icons)('%s is centred on its origin', (_, svg) => {
|
||||
|
||||
Reference in new issue
Block a user