Tabs are open documents: Scene, Game and Plugins stay as fixed tabs, every other asset opens in its own tab (double click or Enter in the asset panel, on creation, from the list button), several assets of one kind can be open at once, a tab is labelled with its kind dimmed before the name, cut at 160 px and renamed with its asset, closes with its x or a middle click and goes away when its asset is deleted; a tab always shows its own document instead of following the selection, the picker in the tab head is gone, zoom and scroll are kept per document for the session and dropped on close, a double click on a call node stays in the same tab with breadcrumbs per tab; one editor per kind is switched between documents, the placement rules live in the pure module documents.ts, and the test hook showTab stays as a compatibility path; new e2e module 44 documents (#171)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f546c0e08
commit
cc285af10a
33 files changed
+895
-225
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import type { Asset, ContainerAsset } from '../../core/model/Asset';
|
||||
import { activeDrag } from '../../ui';
|
||||
import { AssetTabEditor } from '../AssetTabEditor';
|
||||
import type { EditorState } from '../state';
|
||||
import { ContainerCanvas } from './ContainerCanvas';
|
||||
@@ -9,7 +8,7 @@ const INFO_WIDTH = 110;
|
||||
|
||||
export class ContainerEditor extends AssetTabEditor<ContainerAsset, ContainerCanvas> {
|
||||
constructor(state: EditorState) {
|
||||
super(state, { noun: 'Container', infoWidth: INFO_WIDTH });
|
||||
super(state, { infoWidth: INFO_WIDTH });
|
||||
this.mount(new ContainerCanvas(state));
|
||||
}
|
||||
|
||||
@@ -29,14 +28,11 @@ export class ContainerEditor extends AssetTabEditor<ContainerAsset, ContainerCan
|
||||
return { x: p.x, y: p.y, w: this.canvas.w, h: this.canvas.h };
|
||||
}
|
||||
|
||||
protected override selectedId(): string {
|
||||
// A dragged row selects on release, and whether that lands before or after the drop is up
|
||||
// to Pixi's event order. Following it in between would swap the tab to the very container
|
||||
// being dragged, which would then nest in itself, so the target stays put while a drag runs.
|
||||
return activeDrag() ? '' : (this.state.selectedContainerId ?? '');
|
||||
override selectedId(): string {
|
||||
return this.state.selectedContainerId ?? '';
|
||||
}
|
||||
|
||||
protected override isMine(asset: Asset): asset is ContainerAsset {
|
||||
override isMine(asset: Asset): asset is ContainerAsset {
|
||||
return asset.type === 'container';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user