From 9b47b7273bb2f0124fa08fece39057000b58cf98 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Sun, 25 Jan 2026 01:32:39 +0000
Subject: feat: Add contract-scoped file route /contracts/:id/files/:fileId

- Create ContractFilePage component for viewing files within contract context
- Add route for /contracts/:id/files/:fileId in main.tsx
- Update handleFileSelect in contracts.tsx to navigate to contract-scoped file URL
- File viewer now has "Back to Contract" navigation instead of standalone /files

This allows files accessed from a contract to maintain context and return
to the contract page when going back.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---
 makima/frontend/src/main.tsx | 9 +++++++++
 1 file changed, 9 insertions(+)

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

diff --git a/makima/frontend/src/main.tsx b/makima/frontend/src/main.tsx
index 19f02d1..9a6e65e 100644
--- a/makima/frontend/src/main.tsx
+++ b/makima/frontend/src/main.tsx
@@ -17,6 +17,7 @@ import MeshPage from "./routes/mesh";
 import HistoryPage from "./routes/history";
 import LoginPage from "./routes/login";
 import SettingsPage from "./routes/settings";
+import ContractFilePage from "./routes/contract-file";
 
 createRoot(document.getElementById("root")!).render(
   <StrictMode>
@@ -69,6 +70,14 @@ createRoot(document.getElementById("root")!).render(
               </ProtectedRoute>
             }
           />
+          <Route
+            path="/contracts/:id/files/:fileId"
+            element={
+              <ProtectedRoute>
+                <ContractFilePage />
+              </ProtectedRoute>
+            }
+          />
           <Route
             path="/workflow"
             element={
-- 
cgit v1.2.3

