From d1fdfb140cc440664f77a24886172f9976a05a31 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Tue, 28 Apr 2026 19:12:52 +0100
Subject: feat: revert broken directive PRs, re-implement Lexical document
 orchestrator (#98)

* feat: soryu-co/soryu - makima: Revert broken directive PRs and verify clean build

* feat: soryu-co/soryu - makima: Re-implement frontend: Lexical document editor with feature flag and base components

* WIP: heartbeat checkpoint

* feat: soryu-co/soryu - makima: Add contract blocks, expandable log rows, and interaction controls

* WIP: heartbeat checkpoint

* feat: soryu-co/soryu - makima: End-to-end build verification and integration polish
---
 frontend/src/main.tsx | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

(limited to 'frontend/src/main.tsx')

diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
index 9527d8f..7688159 100644
--- a/frontend/src/main.tsx
+++ b/frontend/src/main.tsx
@@ -2,24 +2,23 @@ import React from 'react'
 import ReactDOM from 'react-dom/client'
 import { createBrowserRouter, RouterProvider } from 'react-router-dom'
 import App from './App'
+import { ContractList } from './components/ContractList'
+import { ContractDetail } from './components/ContractDetail'
+import { FileDetail } from './components/FileDetail'
 import { DaemonList } from './components/DaemonList'
 import { DaemonDetail } from './components/DaemonDetail'
-import { DocumentLayout } from './components/document'
 import './styles/pc98.css'
 import './styles/mobile.css'
 
 // Route configuration:
-// Primary (Document UI - when feature flag enabled):
-// - /directives - Document layout with file tree sidebar and Lexical editor
-// - /directives/:id - Open a specific directive in the document editor
-//
-// Legacy (Contract UI - kept for backward compatibility):
 // - /contracts - List all contracts
 // - /contracts/:id - View contract details with tabs (including Files tab)
 // - /contracts/:contractId/files/:fileId - View a specific file within contract context
+// - /directives - Document editor layout (file tree sidebar)
+// - /directives/:id - Document editor for a specific directive
 //
-// Note: When Document UI is enabled via Settings, /directives is the primary interface.
-// The /contracts routes remain available as a legacy fallback.
+// Note: Standalone file routes (/files, /files/:id) have been removed.
+// Files are now only accessible through their parent contract.
 
 const router = createBrowserRouter([
   {
@@ -27,12 +26,16 @@ const router = createBrowserRouter([
     element: <App />,
   },
   {
-    path: '/daemons',
-    element: <DaemonList />,
+    path: '/contracts',
+    element: <ContractList />,
   },
   {
-    path: '/daemons/:id',
-    element: <DaemonDetail />,
+    path: '/contracts/:id',
+    element: <ContractDetail />,
+  },
+  {
+    path: '/contracts/:contractId/files/:fileId',
+    element: <FileDetail />,
   },
   {
     path: '/directives',
@@ -42,6 +45,14 @@ const router = createBrowserRouter([
     path: '/directives/:id',
     element: <DocumentLayout />,
   },
+  {
+    path: '/daemons',
+    element: <DaemonList />,
+  },
+  {
+    path: '/daemons/:id',
+    element: <DaemonDetail />,
+  },
 ])
 
 ReactDOM.createRoot(document.getElementById('root')!).render(
-- 
cgit v1.2.3

