refactor: dedupe the jscpd clones; drop the baseline loading gate
- Extract the shared New Session action into WorkspacesService.startSession (sidebar button and workspace browser both delegate; recent-Workspace targeting and the no-workspace clear live in one place). - Fold the chip-insertion transaction shared by insert-ref and paste-upgrade into one InputMachine helper. - Share the fixture's session-not-found guard across the sessionId-addressed catalog routes. - Drop the AppFrame baselines-ready loading gate (user ruling: the bare status line reads worse than the shell's own pending rendering); both column occupants mount from first paint.
This commit is contained in:
9 files changed
+75
-103
No files matched your search
@@ -85,12 +85,7 @@ export function AppFrame({
|
||||
useStore,
|
||||
actions,
|
||||
renderSlot,
|
||||
useWorkspaces,
|
||||
}: AppFrameProps) {
|
||||
// Baseline gate: before both object-layer baselines land, empty snapshots
|
||||
// are indistinguishable from a genuine no-session state — rendering the
|
||||
// conversation shell then would flash the New Workspace hero on boot.
|
||||
const baselinesReady = useWorkspaces(s => s.baselinesReady)
|
||||
const panels = useStore((s) => s)
|
||||
const frameRef = useRef<HTMLDivElement | null>(null)
|
||||
const [viewport, setViewport] = useState(() => window.innerWidth)
|
||||
@@ -156,24 +151,15 @@ export function AppFrame({
|
||||
width: cols.sidebar,
|
||||
})}
|
||||
</div>
|
||||
{baselinesReady
|
||||
? (
|
||||
<>
|
||||
{/* Both column occupants stay at fixed tree positions. The
|
||||
conversation is session-maybe; the strict details entry
|
||||
naturally renders empty while no session is current. */}
|
||||
<CenterColumn>{renderSlot('conversation', {})}</CenterColumn>
|
||||
<DetailsColumn>{renderSlot('details', {})}</DetailsColumn>
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<CenterColumn>
|
||||
<div role="status">Loading workspaces and sessions…</div>
|
||||
</CenterColumn>
|
||||
<DetailsColumn />
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
{/* Both column occupants stay at fixed tree positions from first
|
||||
paint — no loading gate (user ruling: the bare status line looked
|
||||
worse than the shell's own pending rendering). The conversation
|
||||
is session-maybe; the strict details entry naturally renders
|
||||
empty while no session is current. */}
|
||||
<CenterColumn>{renderSlot('conversation', {})}</CenterColumn>
|
||||
<DetailsColumn>{renderSlot('details', {})}</DetailsColumn>
|
||||
</>
|
||||
{/* The collapsed rail is fixed-width: no resize handle while closed. */}
|
||||
{panels.sidebar > 0 && <DragHandle side="sidebar" left={cols.sidebar} onStart={onSidebarStart} onDrag={onSidebarDrag} onEnd={onDragEnd} />}
|
||||
{cols.details > 0 && <DragHandle side="details" left={viewport - cols.details} onStart={onDetailsStart} onDrag={onDetailsDrag} onEnd={onDragEnd} />}
|
||||
|
||||
Reference in New Issue
Block a user