Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Generator: scene rules as section headers, shot tiles use the selectable card rule

Bitti1de388076dfb
diff --git a/src/components/workspace/GeneratorView.test.tsx b/src/components/workspace/GeneratorView.test.tsx
index 21a7140..1a33f1a 100644
--- a/src/components/workspace/GeneratorView.test.tsx
+++ b/src/components/workspace/GeneratorView.test.tsx
@@ -734,7 +734,7 @@ describe("Generator scene controls", () => {
const state = setup();
fireEvent.click(screen.getByRole("button", { name: "Shot 2 of First scene" }));
fireEvent.change(screen.getByRole("textbox", { name: "Rename shot 2" }), { target: { value: "Doorway reveal" } });
- const shotHeader = screen.getByRole("textbox", { name: "Rename shot 2" }).closest(".ui-item-header");
+ const shotHeader = screen.getByRole("textbox", { name: "Rename shot 2" }).closest<HTMLElement>(".ui-item-header");
const removeButton = within(shotHeader!).getByRole("button", { name: "Delete shot 2" });
expect(removeButton).toHaveClass("icon-button");
expect(removeButton).toHaveTextContent("");
diff --git a/src/components/workspace/SceneBoard.tsx b/src/components/workspace/SceneBoard.tsx
index 14abc11..d188855 100644
--- a/src/components/workspace/SceneBoard.tsx
+++ b/src/components/workspace/SceneBoard.tsx
@@ -56,7 +56,7 @@ type DropTarget = { kind: "scene"; beforeJobId: string | null } | { kind: "shot"
export const isMenuKey = (event: KeyboardEvent): boolean =>
event.key === "ContextMenu" || (event.shiftKey && event.key === "F10");
-/** The Generator board: every scene as a 32px group header with its shots in
+/** The Generator board: every scene as a 28px section header with its shots in
* a tile grid underneath. Headers own the scene-wide actions and timing; a
* tile opens its shot in the inspector. Both are drag sources and drop
* targets, and both carry a right-click menu. */
@@ -268,6 +268,7 @@ export function SceneBoard({
className={[
"scene-section",
selection.jobId === job.id ? "scene-section--current" : "",
+ isCollapsed ? "scene-section--collapsed" : "",
dragging?.kind === "scene" && dragging.jobId === job.id ? "scene-section--dragging" : "",
sceneDrop === job.id ? "scene-section--drop-before" : "",
sceneDrop === null && jobIndex === jobs.length - 1 ? "scene-section--drop-after" : "",
@@ -311,7 +312,7 @@ export function SceneBoard({
aria-expanded={!isCollapsed}
aria-label={`${isCollapsed ? "Expand" : "Collapse"} ${job.title}`}
onClick={() => toggle(job.id)}
- >{isCollapsed ? <ChevronRight size={16} aria-hidden="true" /> : <ChevronDown size={16} aria-hidden="true" />}</button>
+ >{isCollapsed ? <ChevronRight size={12} aria-hidden="true" /> : <ChevronDown size={12} aria-hidden="true" />}</button>
<span
className="scene-rule__drag"
@@ -358,8 +359,10 @@ export function SceneBoard({
>
{job.status !== "draft" && <span className={`scene-rule__status scene-rule__status--${indicator}`}>{statusIcon(indicator, 16)}</span>}
<b className="scene-rule__title" data-tooltip={job.title}>{job.title}</b>
- <span className="scene-rule__caption">{shots.length === 1 ? "1 shot" : `${shots.length} shots`} · {seconds(duration)}</span>
{job.status !== "draft" && indicator !== "generating" && <span className="scene-rule__badge">{STATUS_BADGE[indicator]}</span>}
+ {/* The section's summary, at the trailing edge like any section
+ header's count. */}
+ <span className="scene-rule__caption">{shots.length === 1 ? "1 shot" : `${shots.length} shots`} · {seconds(duration)}</span>
</button>
<label className="scene-rule__length" data-tooltip="Scene length">
@@ -504,7 +507,7 @@ function ShotCard({ job, shot, index, endsAt, folderPath, estimatedCompletionAt,
: "No description";
return <div
- className={`shot-card${open ? " shot-card--open" : ""}${dragSource ? " shot-card--dragging" : ""}`}
+ className={`shot-card ui-selectable ui-selectable--card${open ? " is-selected" : ""}${dragSource ? " shot-card--dragging" : ""}`}
aria-label={`${name} of ${job.title}`}
draggable
onDragStart={onDragStart}
diff --git a/src/styles/generator.css b/src/styles/generator.css
index cf805e6..1b93351 100644
--- a/src/styles/generator.css
+++ b/src/styles/generator.css
@@ -132,9 +132,10 @@
/* --- The board ---------------------------------------------------------------
- Every scene in the project as a 32px group header — the Explorer "group by"
- look: a chevron, the name, a caption, and a divider underneath — with its
- shots as tiles in an auto-filling grid below it.
+ Every scene in the project as a section header — the same 28px chrome strip
+ as the inspector's sections: a chevron, the name at 12px semibold, and the
+ shot count at the trailing edge — with its shots as tiles in an
+ auto-filling grid below it.
========================================================================== */
.scene-board {
@@ -174,11 +175,21 @@
.scene-rule {
min-width: 0;
- min-height: var(--control-md);
+ height: var(--section-row);
display: flex;
align-items: center;
- gap: var(--space-1);
+ gap: 2px;
+ padding: 0 var(--space-1);
+ border-top: 1px solid var(--line);
border-bottom: 1px solid var(--line);
+ background: var(--surface-chrome);
+}
+
+/* One line between two headers, not two, and none under the command bar's
+ divider — the PropSection rule. */
+.scene-section:first-child > .scene-rule,
+.scene-section--collapsed + .scene-section > .scene-rule {
+ border-top-color: transparent;
}
.scene-rule__toggle,
@@ -293,7 +304,7 @@
min-width: 0;
overflow: hidden;
color: var(--text-primary);
- font-size: var(--text-base);
+ font-size: var(--text-xs);
font-weight: var(--weight-semibold);
line-height: var(--leading-snug);
text-overflow: ellipsis;
@@ -308,11 +319,16 @@
white-space: nowrap;
}
+.scene-rule__caption {
+ margin-left: auto;
+ font-variant-numeric: tabular-nums;
+}
+
.scene-rule__badge {
- padding: 0 var(--space-2);
+ padding: 0 var(--space-1);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
- line-height: 18px;
+ line-height: 16px;
}
.scene-rule__length {
@@ -331,8 +347,9 @@
The tile is a SUMMARY and a target: a frame, the name and times, one line
of the shot's words. 4px corners and a hairline edge like any Fluent grid
- item; hover is a fill, the open shot an accent fill with an accent edge.
- The grid auto-fills 200px-and-up columns, so it needs no breakpoints.
+ item; rest, hover and the open shot are the shared selectable-card rule
+ (.ui-selectable--card: an accent fill and ring). The grid auto-fills
+ 200px-and-up columns, so it needs no breakpoints.
========================================================================== */
.shot-grid {
@@ -340,7 +357,7 @@
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: var(--space-2);
margin: 0;
- padding: var(--space-2) 0 var(--space-3);
+ padding: var(--space-2) var(--space-3) var(--space-3);
list-style: none;
}
@@ -383,19 +400,7 @@
border: 1px solid var(--stroke-card);
border-radius: var(--radius-sm);
color: inherit;
- background: var(--card);
text-align: left;
- transition: var(--transition-control);
-}
-
-.shot-card:hover {
- background: var(--card-hover);
-}
-
-.shot-card--open,
-.shot-card--open:hover {
- border-color: var(--accent);
- background: var(--accent-soft);
}
.shot-card--dragging {