app, core: the inspector, the wheel, ratings, a ruler, and a way in

The surfaces v4 has that v5 did not. Each announces itself and each can be
absent without the rest noticing, which is the point of the exercise: the
frontend should read as v4, and nothing in it should be load-bearing for
anything else.

* SCENE AND PROJECT, in the column v4 keeps them in, which now says which
  scene it is about. Length on the timeline is the scene's own CROP and says
  outright that a regenerate reads the project's -- the rule that mixing the
  two is how a per-scene value quietly becomes everyone's.
* RATINGS on a scene, and a clip carries its rating as a colour on its edge.
  Stored, not yet read: nothing in v5 learns from them yet.
* A RULER, and clips as wide as they are long, so the strip reads as time
  rather than a row of equal boxes. Both ends bounded -- one long clip must
  not become the whole strip, and one short one must stay hittable.
* THE PICKER WHEEL, on the middle button anywhere. It shows whatever
  announced itself to actions.js, so a part of the app that grew a new action
  is in the wheel without the wheel being told, and a part that failed to
  load is simply not among them. v4's three pinned buttons had a fixed idea
  of what could go in them.
* THE WAY IN, and it closes -- on Escape, on the backdrop, on its own button.
  v4's could only be completed: a page refresh was the only way out, which
  makes it a trap rather than a wizard. Dismissing is a real answer.
* File > rename, and the listing moves with it rather than going stale until
  a reload.

Two things the kit refused, correctly, and now nobody has to know: a wheel of
fewer than two items throws (there is nothing to aim between), so the shell
does not offer one; and a strip cell with no ceiling took the whole strip.
This commit is contained in:
digital-garbage
2026-09-06 12:30:59 +03:00
parent 33eeff08e3
commit faaa465d68
16 changed files with 719 additions and 29 deletions
+22 -12
View File
@@ -136,6 +136,18 @@ export function createProject({ onChange, onError } = {}) {
changed(); // selection is not saved: it is a view
},
/** What it is called. The listing in the File menu reads this too, so both
* move together rather than the menu going stale until a reload. */
rename(name) {
const clean = String(name || "").trim();
if (!project || !clean || project.name === clean) return;
project.name = clean;
const listed = recent.find((p) => p.id === project.id);
if (listed) listed.name = clean;
scheduleSave();
changed();
},
/** What the whole project generates at, whichever scene is current. */
get video() { return (project && project.video) || {}; },
@@ -148,13 +160,7 @@ export function createProject({ onChange, onError } = {}) {
},
/** The text of one scene. The prompt box on the main window edits this. */
setText(id, text) {
const scene = sceneAt(id);
if (!scene || scene.text === text) return;
scene.text = text;
scheduleSave();
changed();
},
setText(id, text) { this.setScene(id, "text", text); },
addScene() {
if (!project) return null;
@@ -162,7 +168,7 @@ export function createProject({ onChange, onError } = {}) {
// through a timeline is how a scene gets inserted, and appending silently
// would put it somewhere the user was not looking.
const at = project.scenes.findIndex((s) => s.id === selected);
const scene = { id: newId(), text: "", result: null };
const scene = { id: newId(), text: "", result: null, length: null, rating: null };
project.scenes.splice(at < 0 ? project.scenes.length : at + 1, 0, scene);
selected = scene.id; // you add a scene in order to fill it
scheduleSave();
@@ -193,15 +199,19 @@ export function createProject({ onChange, onError } = {}) {
changed();
},
/** Attach what a run produced to the scene it was started from. */
setResult(id, result) {
/** One field of one scene. Everything a scene holds but its id goes through
* here, so there is one place that saves and one that says it changed. */
setScene(id, key, value) {
const scene = sceneAt(id);
if (!scene) return;
scene.result = result;
if (!scene || scene[key] === value) return;
scene[key] = value;
scheduleSave();
changed();
},
/** Attach what a run produced to the scene it was started from. */
setResult(id, result) { this.setScene(id, "result", result); },
flush,
get unsaved() { return dirty; },
};