From 36f65f294ce33325a9eea9b7a8629706a4def721 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 30 Apr 2026 17:06:31 +0100 Subject: feat(doc-mode): rename surfaced label "Directive" → "Contract" (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stage 2: cosmetic UI rename only. Database tables, API paths, hook names, and CLI commands all stay as 'directive' for now — we'll phase out the existing standalone /contracts table later. Surface changes: - Sidebar header "Documents" → "Contracts"; root folder "directives/" → "contracts/"; empty state "No directives yet" → "No contracts yet". - Editor placeholders, breadcrumb header, "back to document" → "back to contract", right-click menu header. - NavStrip: when documentModeEnabled is on, the "Directives" link renders as "Contracts" (href stays /directives so links don't break). - Save bar message "saving will replan the directive" → "the contract". No backend changes — directive.goal etc. all still work the same. Co-authored-by: Claude Opus 4.7 (1M context) --- makima/frontend/src/components/NavStrip.tsx | 35 +++++++++++++--------- .../src/components/directives/DocumentEditor.tsx | 8 ++--- makima/frontend/src/routes/document-directives.tsx | 24 +++++++-------- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx index a6e483d..6fe4ba9 100644 --- a/makima/frontend/src/components/NavStrip.tsx +++ b/makima/frontend/src/components/NavStrip.tsx @@ -62,20 +62,27 @@ export function NavStrip() {
{NAV_LINKS.filter( (link) => !(documentMode && link.hideInDocumentMode), - ).map((link) => ( - - - {link.label} - - {link.label === "Directives" && directiveQuestionCount > 0 && ( - - )} - - ))} + ).map((link) => { + // In document mode, the directive concept is surfaced to the user + // as "Contracts" — keep the same href (/directives) so existing + // links and bookmarks continue to work. + const displayLabel = + documentMode && link.label === "Directives" ? "Contracts" : link.label; + return ( + + + {displayLabel} + + {link.label === "Directives" && directiveQuestionCount > 0 && ( + + )} + + ); + })}
{isAuthenticated && isAuthConfigured ? ( diff --git a/makima/frontend/src/components/directives/DocumentEditor.tsx b/makima/frontend/src/components/directives/DocumentEditor.tsx index 3dd8522..08e4d73 100644 --- a/makima/frontend/src/components/directives/DocumentEditor.tsx +++ b/makima/frontend/src/components/directives/DocumentEditor.tsx @@ -638,7 +638,7 @@ function EditorContextMenu({ style={{ left: x, top: y }} >
- Document + Contract
} className="outline-none font-mono text-[13px] leading-relaxed text-[#dbe7ff] [&_.makima-doc-h1]:text-[24px] [&_.makima-doc-h1]:font-medium [&_.makima-doc-h1]:text-white [&_.makima-doc-h1]:mb-3 [&_.makima-doc-h1]:tracking-tight [&_.makima-doc-paragraph]:my-2 [&_.makima-doc-paragraph]:text-[13px] [&_.makima-doc-paragraph]:text-[#c0d0e0] relative" diff --git a/makima/frontend/src/routes/document-directives.tsx b/makima/frontend/src/routes/document-directives.tsx index 9cb984b..ada8a3d 100644 --- a/makima/frontend/src/routes/document-directives.tsx +++ b/makima/frontend/src/routes/document-directives.tsx @@ -657,17 +657,17 @@ function DocumentSidebar({ {/* Sidebar header */}
- Documents + Contracts {directives.length}
- {/* Top-level "directives/" folder header (informational, non-interactive). */} + {/* Top-level "contracts/" folder header (informational, non-interactive). */}
- directives/ + contracts/
{/* Body */} @@ -678,7 +678,7 @@ function DocumentSidebar({ ) : directives.length === 0 ? (
- No directives yet + No contracts yet
) : ( sorted.map((d) => ( @@ -735,10 +735,10 @@ function EditorShell({

{listLoading - ? "Loading documents..." + ? "Loading contracts..." : hasDirectives - ? "Select a document from the sidebar" - : "No documents yet — create one from the legacy UI"} + ? "Select a contract from the sidebar" + : "No contracts yet — create one from the legacy UI"}

); @@ -747,7 +747,7 @@ function EditorShell({ if (loading && !directive) { return (
-

Loading document...

+

Loading contract...

); } @@ -755,7 +755,7 @@ function EditorShell({ if (!directive) { return (
-

Document not found

+

Contract not found

); } @@ -772,11 +772,11 @@ function EditorShell({ return (
- {/* Document header — breadcrumb-like, mirrors a code editor's tab bar */} + {/* Contract header — breadcrumb-like, mirrors a code editor's tab bar */}
- directives / + contracts / {directive.id.slice(0, 8)} {selectedTaskId && ( <> @@ -787,7 +787,7 @@ function EditorShell({ onClick={onClearTask} className="ml-2 px-1.5 py-0.5 text-[#7788aa] hover:text-white border border-[#2a3a5a] rounded normal-case" > - back to document + back to contract )} -- cgit v1.2.3