[object Object]

← back to Consulting Designerwallcoverings Com

TK-22 signin: hydrate front door from /api/client (fixes stale empty tagline + dangling 'Reach ·')

c46dce52f99bbad95129bd62502215c7aa87096d · 2026-07-27 21:15:16 -0700 · Steve Abrams

The signin page rendered hard-coded static HTML: an empty <p class=sub> tagline
and a 'Reach: email · ' field with a trailing separator and no phone — even though
client.json now carries a tagline + phone and server.js already serves /api/client
as the "public-safe summary for signin page" that the page never consumed. Wire the
page to hydrate #tagline / #meta / #reach from /api/client (HTML-entity-decoded for
text), keeping the static markup as graceful fallback. Also drop the trailing ' · '
from the static Reach so the no-JS state is clean too. Verified in headless Chrome:
tagline + email·phone render, no double-escape, no console errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit c46dce52f99bbad95129bd62502215c7aa87096d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jul 27 21:15:16 2026 -0700

    TK-22 signin: hydrate front door from /api/client (fixes stale empty tagline + dangling 'Reach ·')
    
    The signin page rendered hard-coded static HTML: an empty <p class=sub> tagline
    and a 'Reach: email · ' field with a trailing separator and no phone — even though
    client.json now carries a tagline + phone and server.js already serves /api/client
    as the "public-safe summary for signin page" that the page never consumed. Wire the
    page to hydrate #tagline / #meta / #reach from /api/client (HTML-entity-decoded for
    text), keeping the static markup as graceful fallback. Also drop the trailing ' · '
    from the static Reach so the no-JS state is clean too. Verified in headless Chrome:
    tagline + email·phone render, no double-escape, no console errors.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 public/signin.html | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/public/signin.html b/public/signin.html
index 24e9cd4..bdaba09 100644
--- a/public/signin.html
+++ b/public/signin.html
@@ -28,16 +28,16 @@
 <body>
   <div class="card">
     <div class="eyebrow">Consulting Engagement</div>
-    <h1>Designer Wallcoverings</h1>
-    <p class="sub"></p>
+    <h1 id="biz">Designer Wallcoverings</h1>
+    <p class="sub" id="tagline"></p>
 
     <div class="grid" id="meta">
-      <div><b>Industry</b>Luxury wallcoverings & designer fabrics — e-commerce + to-the-trade</div>
-      <div><b>Location</b>Los Angeles, CA</div>
-      <div><b>Current Site</b>none yet</div>
-      <div><b>Engagement Opened</b>2026-07-26</div>
-      <div><b>Primary Contact</b>Steve Abrams</div>
-      <div><b>Reach</b>steve@designerwallcoverings.com · </div>
+      <div><b>Industry</b><span id="m-industry">Luxury wallcoverings & designer fabrics — e-commerce + to-the-trade</span></div>
+      <div><b>Location</b><span id="m-location">Los Angeles, CA</span></div>
+      <div><b>Current Site</b><span id="m-site">none yet</span></div>
+      <div><b>Engagement Opened</b><span id="m-opened">2026-07-26</span></div>
+      <div><b>Primary Contact</b><span id="m-contact">Steve Abrams</span></div>
+      <div><b>Reach</b><span id="m-reach">steve@designerwallcoverings.com</span></div>
     </div>
 
     <!-- Steve's standing rule: the initial sign-in page CARRIES the credentials. -->
@@ -63,5 +63,31 @@
       New client, or no website yet? <a href="/intake">Start the intake questionnaire →</a>
     </div>
   </div>
+
+  <!-- Hydrate the front door from /api/client (server.js:90 serves this as the
+       "public-safe summary for signin page"). Fixes the previously-stale static
+       HTML (empty tagline, dangling "Reach: …·"). Static markup above is the
+       graceful fallback if the fetch fails — the page never renders empty. -->
+  <script>
+  (function(){
+    function set(id,v){ if(v==null||v==='')return; var el=document.getElementById(id); if(el)el.textContent=v; }
+    // client.json stores the tagline HTML-escaped (e.g. "&amp;"); decode for text.
+    function decode(s){ if(!s)return s; var t=document.createElement('textarea'); t.innerHTML=s; return t.value; }
+    fetch('/api/client').then(function(r){ return r.ok?r.json():null; }).then(function(c){
+      if(!c||typeof c!=='object') return;
+      set('biz', c.business_name);
+      if(c.business_name) document.title = c.business_name + ' · Consulting Portal';
+      set('tagline', decode(c.tagline));
+      set('m-industry', decode(c.industry));
+      set('m-location', c.location);
+      set('m-site', c.current_website || 'none yet');
+      set('m-opened', c.generated_at);
+      var ct = c.contact || {};
+      set('m-contact', ct.name);
+      var reach = [ct.email, ct.phone].filter(Boolean).join(' · ');
+      set('m-reach', reach);
+    }).catch(function(){ /* keep static fallback */ });
+  })();
+  </script>
 </body>
 </html>

← 4fcf330 TK-22 admin-UX: add created date+time chip to Low Hanging Fr  ·  back to Consulting Designerwallcoverings Com  ·  (newest)