Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: redesign FableLoom series plan page with persistent right rail for AI tools and Save Plan

[._.]/ Adam Eivy1192cd0ac3ba
diff --git a/client/src/components/fableloom/LoomSeriesPlan.jsx b/client/src/components/fableloom/LoomSeriesPlan.jsx
index c421ae099f..8f4f827749 100644
--- a/client/src/components/fableloom/LoomSeriesPlan.jsx
+++ b/client/src/components/fableloom/LoomSeriesPlan.jsx
@@ -121,71 +121,87 @@ export default function LoomSeriesPlan({ loom, onLoomUpdate }) {
label={`Discard unsaved changes to ${loom.name}`}
onDiscard={discardAndExit}
/>
- <div className="max-w-5xl mx-auto space-y-6">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h2 className="text-lg font-semibold">Series plan</h2>
- <p className="text-sm text-port-text-muted mt-1">
- Shape the full narrative before working inside individual episode graphs.
- </p>
- </div>
- <button
- type="button"
- onClick={save}
- disabled={!dirty || saving}
- className="shrink-0 flex items-center gap-2 px-3 py-2 rounded bg-port-accent text-white text-sm disabled:opacity-50"
- >
- {saving ? <Loader2 size={14} className="animate-spin" /> : <Save size={14} />}
- {saving ? 'Saving…' : 'Save plan'}
- </button>
- </div>
+ <div className="max-w-7xl mx-auto">
+ <div className="flex flex-col lg:flex-row items-start gap-6">
+ <div className="flex-1 min-w-0 w-full space-y-6">
+ <div>
+ <h2 className="text-lg font-semibold">Series plan</h2>
+ <p className="text-sm text-port-text-muted mt-1">
+ Shape the full narrative before working inside individual episode graphs.
+ </p>
+ </div>
- <div className="rounded-lg border border-port-border bg-port-card p-4">
- <FormField
- label="Story arc"
- hint="The beginning-to-end dramatic movement, central conflict, and intended resolution."
- labelClassName={labelClass}
- >
- <textarea
- rows={7}
- className={fieldClass}
- value={plan.storyArc}
- placeholder="What changes across the series, why it matters, and where the story lands…"
- onChange={(event) => changePlan((current) => ({ ...current, storyArc: event.target.value }))}
+ <div className="rounded-lg border border-port-border bg-port-card p-4">
+ <FormField
+ label="Story arc"
+ hint="The beginning-to-end dramatic movement, central conflict, and intended resolution."
+ labelClassName={labelClass}
+ >
+ <textarea
+ rows={7}
+ className={fieldClass}
+ value={plan.storyArc}
+ placeholder="What changes across the series, why it matters, and where the story lands…"
+ onChange={(event) => changePlan((current) => ({ ...current, storyArc: event.target.value }))}
+ />
+ </FormField>
+ </div>
+
+ <PlanCollection
+ title="Plot points"
+ description="Order the tentpole beats and connect each one to the episode where it should land."
+ items={plan.plotPoints}
+ episodes={episodeOptions}
+ onAdd={() => changePlan((current) => ({ ...current, plotPoints: [...current.plotPoints, {
+ id: newItemId('plot'), title: '', description: '', episodeId: null,
+ }] }))}
+ onUpdate={(id, patch) => updateItem('plotPoints', id, patch)}
+ onRemove={(id) => removeItem('plotPoints', id)}
+ onMove={(index, direction) => moveItem('plotPoints', index, direction)}
/>
- </FormField>
- </div>
- <PlanCollection
- title="Plot points"
- description="Order the tentpole beats and connect each one to the episode where it should land."
- items={plan.plotPoints}
- episodes={episodeOptions}
- onAdd={() => changePlan((current) => ({ ...current, plotPoints: [...current.plotPoints, {
- id: newItemId('plot'), title: '', description: '', episodeId: null,
- }] }))}
- onUpdate={(id, patch) => updateItem('plotPoints', id, patch)}
- onRemove={(id) => removeItem('plotPoints', id)}
- onMove={(index, direction) => moveItem('plotPoints', index, direction)}
- />
+ <PlanCollection
+ title="Side quests"
+ description="Track supporting threads without letting them disappear inside a single episode."
+ items={plan.sideQuests}
+ episodes={episodeOptions}
+ sideQuests
+ onAdd={() => changePlan((current) => ({ ...current, sideQuests: [...current.sideQuests, {
+ id: newItemId('quest'), title: '', description: '', status: 'idea', startEpisodeId: null, endEpisodeId: null,
+ }] }))}
+ onUpdate={(id, patch) => updateItem('sideQuests', id, patch)}
+ onRemove={(id) => removeItem('sideQuests', id)}
+ onMove={(index, direction) => moveItem('sideQuests', index, direction)}
+ />
+ </div>
- <PlanCollection
- title="Side quests"
- description="Track supporting threads without letting them disappear inside a single episode."
- items={plan.sideQuests}
- episodes={episodeOptions}
- sideQuests
- onAdd={() => changePlan((current) => ({ ...current, sideQuests: [...current.sideQuests, {
- id: newItemId('quest'), title: '', description: '', status: 'idea', startEpisodeId: null, endEpisodeId: null,
- }] }))}
- onUpdate={(id, patch) => updateItem('sideQuests', id, patch)}
- onRemove={(id) => removeItem('sideQuests', id)}
- onMove={(index, direction) => moveItem('sideQuests', index, direction)}
- />
+ <aside className="w-full lg:w-[380px] xl:w-[420px] shrink-0 space-y-6 lg:sticky lg:top-0 lg:max-h-[calc(100vh-3rem)] lg:overflow-y-auto" aria-label="AI tools and actions">
+ <div className="rounded-lg border border-port-border bg-port-card p-4 space-y-3">
+ <div className="flex items-center justify-between gap-3">
+ <div>
+ <h3 className="font-semibold text-sm">Series plan actions</h3>
+ <p className="text-xs flex items-center gap-1.5 mt-0.5">
+ <span className={`inline-block w-2 h-2 rounded-full ${dirty ? 'bg-amber-400' : 'bg-emerald-400'}`} />
+ <span className="text-port-text-muted">{dirty ? 'Unsaved changes' : 'All changes saved'}</span>
+ </p>
+ </div>
+ <button
+ type="button"
+ onClick={save}
+ disabled={!dirty || saving}
+ className="shrink-0 flex items-center gap-2 px-3 py-2 rounded bg-port-accent text-white text-sm disabled:opacity-50 font-medium"
+ >
+ {saving ? <Loader2 size={14} className="animate-spin" /> : <Save size={14} />}
+ {saving ? 'Saving…' : 'Save plan'}
+ </button>
+ </div>
+ </div>
- <SeriesAiEditor loom={loom} dirty={dirty} onLoomUpdate={adoptServerPlan} />
+ <SeriesAiEditor loom={loom} dirty={dirty} onLoomUpdate={adoptServerPlan} />
- <WholeEpisodeEditor loom={loom} dirty={dirty} onLoomUpdate={onLoomUpdate} />
+ <WholeEpisodeEditor loom={loom} dirty={dirty} onLoomUpdate={onLoomUpdate} />
+ </aside>
+ </div>
</div>
</section>
);
diff --git a/client/src/components/fableloom/LoomSeriesPlan.test.jsx b/client/src/components/fableloom/LoomSeriesPlan.test.jsx
index 06f3685e67..e9b9985d79 100644
--- a/client/src/components/fableloom/LoomSeriesPlan.test.jsx
+++ b/client/src/components/fableloom/LoomSeriesPlan.test.jsx
@@ -136,4 +136,17 @@ describe('LoomSeriesPlan', () => {
await waitFor(() => expect(screen.getByRole('textbox', { name: /story arc/i })).toHaveValue('Typed while saving.'));
expect(screen.getByRole('button', { name: /save plan/i })).toBeEnabled();
});
+
+ it('renders AI tools and save plan within the persistent desktop rail beside the story content', () => {
+ renderPlan({ loom: loom(), onLoomUpdate: () => {} });
+ const rightRail = screen.getByRole('complementary', { name: /ai tools and actions/i });
+ expect(rightRail).toBeInTheDocument();
+ expect(rightRail.className).toContain('lg:sticky');
+ expect(rightRail.className).toContain('lg:top-0');
+
+ // Confirm actions and AI tools reside within the right rail
+ expect(rightRail).toContainElement(screen.getByRole('button', { name: /save plan/i }));
+ expect(rightRail).toContainElement(screen.getByRole('button', { name: /analyze series/i }));
+ expect(rightRail).toContainElement(screen.getByRole('button', { name: /(draft|regenerate) full plan/i }));
+ });
});