From 36f65f294ce33325a9eea9b7a8629706a4def721 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
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) <noreply@anthropic.com>
---
 makima/frontend/src/components/NavStrip.tsx | 35 +++++++++++++++++------------
 1 file changed, 21 insertions(+), 14 deletions(-)

(limited to 'makima/frontend/src/components/NavStrip.tsx')

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() {
       <div className="flex flex-wrap gap-2 items-center flex-1">
         {NAV_LINKS.filter(
           (link) => !(documentMode && link.hideInDocumentMode),
-        ).map((link) => (
-          <span key={link.label} className="relative inline-flex items-center">
-            <RewriteLink
-              to={link.href}
-              disabled={link.requiresAuth && !hasAccess}
-              external={link.external}
-            >
-              {link.label}
-            </RewriteLink>
-            {link.label === "Directives" && directiveQuestionCount > 0 && (
-              <span className="ml-0.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse" title={`${directiveQuestionCount} pending question(s)`} />
-            )}
-          </span>
-        ))}
+        ).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 (
+            <span key={link.label} className="relative inline-flex items-center">
+              <RewriteLink
+                to={link.href}
+                disabled={link.requiresAuth && !hasAccess}
+                external={link.external}
+              >
+                {displayLabel}
+              </RewriteLink>
+              {link.label === "Directives" && directiveQuestionCount > 0 && (
+                <span className="ml-0.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse" title={`${directiveQuestionCount} pending question(s)`} />
+              )}
+            </span>
+          );
+        })}
       </div>
       <div className="flex items-center gap-2 pl-2.5 border-l border-[rgba(117,170,252,0.35)]">
         {isAuthenticated && isAuthConfigured ? (
-- 
cgit v1.2.3

