Partie frontend. Ajoute un adaptateur focusedProject et un port dédié : la ViewWindow détachée n'est plus liée à un project_id figé, elle s'abonne à l'event focused-project émis par la fenêtre principale et affiche le panneau du projet courant. ProjectsView propage le focus ; le détachement crée une fenêtre panel-only. Couvert par les tests window/ViewWindow/focusedProject/ ProjectsView.focus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
928 B
TypeScript
32 lines
928 B
TypeScript
/** React bootstrap: mounts the app inside the DI provider. */
|
|
|
|
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
|
|
import { App } from "./App";
|
|
import { ViewWindow, parseViewWindowParams } from "./ViewWindow";
|
|
import { DIProvider } from "./di";
|
|
import "@/shared/styles/theme.css";
|
|
|
|
const root = document.getElementById("root");
|
|
if (!root) {
|
|
throw new Error("missing #root element");
|
|
}
|
|
|
|
// #23/#47: a detached view window loads the SPA with `?panel=` (panel-only, no
|
|
// project id). When the param is present and valid, render only that view — it
|
|
// follows the main window's focused project; otherwise the full app.
|
|
const viewParams = parseViewWindowParams(window.location.search);
|
|
|
|
ReactDOM.createRoot(root).render(
|
|
<React.StrictMode>
|
|
<DIProvider>
|
|
{viewParams ? (
|
|
<ViewWindow panel={viewParams.panel} />
|
|
) : (
|
|
<App />
|
|
)}
|
|
</DIProvider>
|
|
</React.StrictMode>,
|
|
);
|