Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Repair media grid and collapse editor panels

Bitti8641bf106a78
diff --git a/src/components/workspace/ReferencesView.tsx b/src/components/workspace/ReferencesView.tsx
index 1750f37..c49a3d8 100644
--- a/src/components/workspace/ReferencesView.tsx
+++ b/src/components/workspace/ReferencesView.tsx
@@ -57,7 +57,9 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
</div>
</header>
<div className="reference-layout">
- <section className="reference-library">
+ <section className="reference-library" aria-labelledby="reference-library-heading">
+ {/* Both regions used to start at h3, so the outline jumped h1 → h3. */}
+ <h2 className="sr-only" id="reference-library-heading">Reference library</h2>
<div className="reference-library__toolbar"><span>{config.references.length === 1 ? "1 reference" : `${config.references.length} references`}</span></div>
<div className="reference-grid">
{config.references.map((ref) => <button key={ref.id} className={selectedId === ref.id ? "selected" : ""} onClick={() => setSelectedId(ref.id)}>
@@ -70,7 +72,7 @@ export function ReferencesView({ config, folderPath, onChange }: { config: Proje
</section>
<aside className="reference-inspector">
- <div className="panel-chrome"><span>Reference details</span>{selected && <button onClick={remove} aria-label="Delete reference" title="Delete this reference"><Trash2 size={16} /></button>}</div>
+ <div className="panel-chrome"><h2>Reference details</h2>{selected && <button onClick={remove} aria-label="Delete reference" title="Delete this reference"><Trash2 size={16} /></button>}</div>
{selected ? <>
<div className={`reference-detail-art reference-detail-art--${selected.kind}`}><span>{selected.kind === "image" ? <Image size={30} /> : <Users size={30} />}</span><em>{selected.kind === "image" ? selected.relativePath : "Reusable text definition"}</em></div>
<div className="reference-fields">
diff --git a/src/components/workspace/TimelineView.tsx b/src/components/workspace/TimelineView.tsx
index c74dc8b..7076c64 100644
--- a/src/components/workspace/TimelineView.tsx
+++ b/src/components/workspace/TimelineView.tsx
@@ -69,13 +69,16 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
if ((event.key === "Delete" || event.key === "Backspace") && event.target === event.currentTarget) removeSelected();
if (event.code === "Space" && event.target === event.currentTarget) { event.preventDefault(); setPlaying((value) => !value); }
}}>
+ {/* The view had no top-level heading at all, so screen-reader users had
+ no landmark for it. Sighted users already see the project topbar. */}
+ <h1 className="sr-only">Timeline editor</h1>
<div className="edit-panels">
<aside className="scene-panel">
<div className="panel-tabs">
<button className={panelTab === "scenes" ? "active" : ""} onClick={() => setPanelTab("scenes")}><Layers3 size={16} /> Scenes</button>
<button className={panelTab === "media" ? "active" : ""} onClick={() => setPanelTab("media")}><Film size={16} /> Media</button>
</div>
- <div className="scene-panel__head"><span>{panelTab === "scenes" ? "Story sequence" : "Project media"}</span></div>
+ <div className="scene-panel__head"><h2>{panelTab === "scenes" ? "Story sequence" : "Project media"}</h2></div>
{panelTab === "scenes" ? (
<div className="scene-list">
{sceneClips.map((clip, index) => (
@@ -99,7 +102,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
</aside>
<main className="program-panel">
- <div className="panel-chrome"><span><i className="live-dot" /> Program monitor</span></div>
+ <div className="panel-chrome"><h2><i className="live-dot" /> Program monitor</h2></div>
<div className="program-canvas">
{hasVisualOutput ? (
<div className="program-empty program-empty--footage">
@@ -129,7 +132,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
</main>
<aside className="clip-inspector">
- <div className="panel-chrome"><span>Clip details</span></div>
+ <div className="panel-chrome"><h2>Clip details</h2></div>
{selected ? <>
<div className="inspector-summary"><span className="clip-chip" style={{ background: selected.color }}><Film size={18} /></span><div><b>{selected.label}</b><small>{selectedTrack?.name} · {selected.status}</small></div></div>
<section className="inspector-section">
@@ -162,7 +165,7 @@ export function TimelineView({ config, onChange, onOpenGenerator }: { config: Pr
<section className="pro-timeline">
<header className="timeline-toolbar">
- <div><strong>Timeline</strong><span>{timecode(playhead)}</span></div>
+ <div><h2>Timeline</h2><span>{timecode(playhead)}</span></div>
<div className="timeline-tools">
<button onClick={addScene} title="Draft a new scene"><Plus size={16} /> Add</button>
<button onClick={splitSelected} disabled={!selected || selectedTrack?.locked} title="Split at playhead"><Scissors size={16} /> Split</button>
diff --git a/src/styles/references.css b/src/styles/references.css
index ec43a2f..06affa1 100644
--- a/src/styles/references.css
+++ b/src/styles/references.css
@@ -79,6 +79,19 @@
line-height: var(--leading-snug);
}
+/* A real <h2> in the chrome (the outline used to jump h1 → h3), styled to look
+ exactly like the <span> it replaced. */
+.reference-inspector > .panel-chrome h2 {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ margin: 0;
+ color: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+ line-height: inherit;
+}
+
.reference-inspector > .panel-chrome button {
width: var(--control-sm);
height: var(--control-sm);
@@ -504,6 +517,12 @@
color: var(--accent-bright);
}
+/* Without min-width:0 the nowrap path below sets a min-content floor that
+ pushed the inspector wider than its column at narrow window sizes. */
+.portable-path > div {
+ min-width: 0;
+}
+
.portable-path b,
.portable-path code {
display: block;
@@ -517,7 +536,7 @@
}
.portable-path code {
- max-width: 280px;
+ max-width: 100%;
margin-top: var(--space-1);
overflow: hidden;
white-space: nowrap;
@@ -644,9 +663,17 @@
/* --- Responsive ------------------------------------------------------------ */
+/* The window can be dragged to 900px (see tauri.conf.json). The old
+ `minmax(600px, 1fr) 368px` library minimum alone put the floor at 968px
+ before page padding, so the view scrolled sideways well before 900px.
+
+ 1180px drop the library's fixed minimum so it can actually flex
+ 1040px stack: the inspector moves under the library instead of squeezing it
+ 900px reference cards go single-column and the header stacks */
+
@media (max-width: 1180px) {
.reference-layout {
- grid-template-columns: minmax(520px, 1fr) 328px;
+ grid-template-columns: minmax(0, 1fr) 328px;
}
.reference-grid > button {
@@ -658,9 +685,35 @@
}
}
+@media (max-width: 1040px) {
+ .reference-layout {
+ grid-template-columns: minmax(0, 1fr);
+ min-height: 0;
+ }
+
+ /* Stacked, the divider belongs between the rows, and the inspector scrolls
+ with the page rather than inside its own box. */
+ .reference-library {
+ border-right: 0;
+ border-bottom: 1px solid var(--line);
+ }
+
+ .reference-inspector {
+ overflow-y: visible;
+ }
+}
+
@media (max-width: 900px) {
.references-heading {
flex-direction: column;
align-items: flex-start;
}
+
+ .references-view {
+ padding-inline: var(--space-4);
+ }
+
+ .reference-grid {
+ grid-template-columns: minmax(0, 1fr);
+ }
}
diff --git a/src/styles/timeline.css b/src/styles/timeline.css
index 77f3b64..a5acaf9 100644
--- a/src/styles/timeline.css
+++ b/src/styles/timeline.css
@@ -80,6 +80,24 @@
background: var(--accent-bright);
}
+/* --- Region headings -------------------------------------------------------
+ The edit view now carries a real heading outline (sr-only h1 → h2 per region
+ → h3 inside the inspector). These h2s replace the plain <span>/<strong> that
+ used to sit in the panel chrome, so they inherit the exact same look. */
+
+.scene-panel__head h2,
+.program-panel > .panel-chrome h2,
+.clip-inspector > .panel-chrome h2 {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ margin: 0;
+ color: inherit;
+ font-size: inherit;
+ font-weight: inherit;
+ line-height: inherit;
+}
+
/* --- Scene panel ----------------------------------------------------------- */
.scene-panel__head {
@@ -225,6 +243,14 @@
overflow-y: auto;
display: grid;
grid-template-columns: 1fr 1fr;
+ /* The height above is DEFINITE, so the default `grid-auto-rows: auto` divided
+ it between the rows instead of letting them size to their content — every
+ media card collapsed to a ~29px striped slab with its name, kind and
+ duration clipped away by the `overflow: hidden` below. `max-content` makes
+ each row as tall as the card it holds and lets the container scroll.
+ `align-content: start` alone does NOT fix this; the row sizing does. */
+ grid-auto-rows: max-content;
+ align-content: start;
gap: var(--space-2);
padding: 0 var(--space-2) var(--space-3);
}
@@ -235,6 +261,8 @@
.media-grid button {
min-width: 0;
+ /* Floor the hit target even if a card ever renders without its labels. */
+ min-height: var(--control-sm);
padding: 0 0 var(--space-2);
overflow: hidden;
border: 1px solid var(--line);
@@ -653,7 +681,8 @@
gap: var(--space-4);
}
-.timeline-toolbar strong {
+.timeline-toolbar h2 {
+ margin: 0;
color: var(--text-primary);
font-size: var(--text-base);
font-weight: var(--weight-semibold);
@@ -942,9 +971,19 @@
/* --- Responsive ------------------------------------------------------------ */
+/* The Tauri window may be resized down to 900px (see tauri.conf.json), so the
+ editor has to survive 900–1180px without ever scrolling sideways. The old
+ `minmax(460px, 1fr)` centre column alone forced a 1036px floor. Each step
+ below drops the least essential column; the program monitor always survives.
+
+ 1180px three columns, narrower sides, monitor floor removed
+ 1040px two columns — the clip inspector goes first
+ 840px one column — the scene panel goes too (below the 900px window
+ minimum, kept so an odd DPI/zoom combination still lays out) */
+
@media (max-width: 1180px) {
.edit-panels {
- grid-template-columns: 264px minmax(460px, 1fr) 312px;
+ grid-template-columns: 256px minmax(0, 1fr) 300px;
}
.scene-card {
@@ -957,3 +996,45 @@
--track-column: 200px;
}
}
+
+@media (max-width: 1040px) {
+ .edit-panels {
+ grid-template-columns: 232px minmax(0, 1fr);
+ }
+
+ /* Everything here is either read-only or already disabled, and the clip name
+ stays editable from the timeline clip itself, so this is the safe cut. */
+ .clip-inspector {
+ display: none;
+ }
+
+ .timeline-grid {
+ --track-column: 184px;
+ }
+
+ .monitor-transport {
+ gap: var(--space-2);
+ padding: 0 var(--space-3);
+ }
+
+ .monitor-transport > span {
+ min-width: 0;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+}
+
+@media (max-width: 840px) {
+ .edit-panels {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ .scene-panel {
+ display: none;
+ }
+
+ .timeline-grid {
+ --track-column: 168px;
+ }
+}