feat(ui): rating block placeholder shows while the selected scene has a render

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-10-03 22:06:28 +03:00
co-authored by Claude Sonnet 5.5
parent f8b0a4b89d
commit e9d0eb226d
+17 -1
View File
@@ -1,5 +1,21 @@
// Stand-ins that sit BEFORE a real feature in the same row (see index.js).
import { composer as c } from "../../composer/composer.js";
export default [{ id: "placeholder:sampler", mount: "timeline.status",
// v4's rating block: "Scene N · Rate…", shown only while the selected scene has a render. Inert until ratings land.
const rating = { id: "placeholder:rating", mount: "timeline.actions", needs: ["project"],
setup({ host, app }) {
const p = app.project;
const label = c.text.sm({ text: "" }), rate = c.button.sm({ label: "Rate…", tone: "ghost", disabled: true });
const box = c.toolbar.default({ items: [label, rate] });
host.append(box.node);
const draw = () => {
const sc = p.selected, has = sc && p.project && (p.project.scene_renders || {})[sc.id];
box.node.hidden = !has;
if (has) label.setText ? label.setText(`Scene ${p.scenes.indexOf(sc) + 1}`) : (label.node.textContent = `Scene ${p.scenes.indexOf(sc) + 1}`);
};
draw();
return app.on(draw);
} };
export default [rating, { id: "placeholder:sampler", mount: "timeline.status",
setup: ({ host }) => host.append(c.button.sm({ label: "⏱ Sampler", tone: "neutral", disabled: true }).node) }];