summaryrefslogtreecommitdiff
path: root/makima/frontend/src/routes/directives.tsx
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-04-29 01:10:11 +0100
committerGitHub <noreply@github.com>2026-04-29 01:10:11 +0100
commit4b1d608b839769052634b4facc345b891d468926 (patch)
tree1d5ff45b5b34b2e3e378a4cf69fd62ff39cf12de /makima/frontend/src/routes/directives.tsx
parent5bde7c2d7e099fd9c8b2615602ab1d096bd9b6be (diff)
downloadsoryu-4b1d608b839769052634b4facc345b891d468926.tar.gz
soryu-4b1d608b839769052634b4facc345b891d468926.zip
feat: document-mode directive UI proof of concept (Lexical) (#101)
* WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Backend: feature flag + goal-edit interrupt messaging * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Frontend: Lexical document editor with step blocks, context menu, countdown
Diffstat (limited to 'makima/frontend/src/routes/directives.tsx')
-rw-r--r--makima/frontend/src/routes/directives.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/makima/frontend/src/routes/directives.tsx b/makima/frontend/src/routes/directives.tsx
index 8de0335..895c86a 100644
--- a/makima/frontend/src/routes/directives.tsx
+++ b/makima/frontend/src/routes/directives.tsx
@@ -5,10 +5,43 @@ import { DirectiveList } from "../components/directives/DirectiveList";
import { DirectiveDetail } from "../components/directives/DirectiveDetail";
import { useDirectives, useDirective } from "../hooks/useDirectives";
import { useDogs } from "../hooks/useDogs";
+import { useUserSettings } from "../hooks/useUserSettings";
import { useAuth } from "../contexts/AuthContext";
+import DocumentDirectivesPage from "./document-directives";
import { getRepositorySuggestions, startDirective, pauseDirective, updateDirective, type RepositoryHistoryEntry, type DirectiveSummary } from "../lib/api";
+/**
+ * Top-level /directives route. Gates between the legacy tabular UI and the
+ * Document Mode (POC) UI based on the user's settings flag.
+ *
+ * Both code paths support /directives/:id deep links — the param is read by
+ * each branch independently via useParams.
+ */
export default function DirectivesPage() {
+ const { settings, loading: settingsLoading } = useUserSettings();
+
+ // While settings are loading for the very first time, render nothing inside
+ // a Masthead-wrapped shell so we don't briefly flash the legacy UI just to
+ // swap to document mode a moment later.
+ if (settingsLoading && !settings) {
+ return (
+ <div className="relative z-10 min-h-screen flex flex-col bg-[#0a1628]">
+ <Masthead showNav />
+ <main className="flex-1 flex items-center justify-center">
+ <p className="text-[#7788aa] font-mono text-sm">Loading...</p>
+ </main>
+ </div>
+ );
+ }
+
+ if (settings?.documentModeEnabled) {
+ return <DocumentDirectivesPage />;
+ }
+
+ return <LegacyDirectivesPage />;
+}
+
+function LegacyDirectivesPage() {
const { isAuthenticated, isAuthConfigured, isLoading: authLoading } = useAuth();
const navigate = useNavigate();
const { id: selectedId } = useParams<{ id: string }>();