From 67068996b39089494b7efd085c64f44c19b3f276 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Thu, 21 May 2026 18:09:05 -0600 Subject: [PATCH 1/2] fix(tangle-cloud): chain-read fallback for /blueprints/:id + surface elevation restyle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: /blueprints/1, /blueprints/2, etc. all 404'd on develop because useBlueprint / useBlueprintDetails were GraphQL-only — the list page had a chain-read fallback (shipped earlier) but the detail hooks didn't, so they returned null on networks without a hosted Envio indexer (testnet today) and the route navigated to NOT_FOUND. Add fetchBlueprintByIdOnChain (Tangle.getBlueprint + getBlueprintDefinition for a single id) and wire it into both useBlueprint and useBlueprintDetails with the same try-Envio-then-fall-back-to-chain pattern as useBlueprints. UX: the cloud app's color hierarchy collapsed because of two things: 1. The theme tokens had ~7% delta between --bg-root (#0b0c19) and --bg-card (#17172a). Cards were visually identical to the page. 2. `[data-sandbox-ui] .bg-card / .bg-muted/* { ... !important }` forced every sandbox-ui Card variant ("elevated", "sandbox") to flatten back to plain bg-card, defeating the variant's `bg-muted/50` lift. Fix the tokens (darker root, lifted card to #1b1a2c, lifted elevated to #262448, add --shadow-hover, add --accent-surface-soft) and rebind the utility classes inside `:where()` so component-level variants win. Then sweep the highest-traffic surfaces — home hero, blueprints hero, blueprint cards, blueprint detail, account stats card, sidebar, header — and strip every `className="border-border bg-card"` override on `variant="sandbox"` / `variant="elevated"` cards. Those overrides were turning every variant into the same flat box. Add a categoryColor helper that maps the six blueprint categories (Inference, Training, Agents, Data, Trading, Other) to stable HSL hues, and use it as a top-stripe + colored category badge on cards. Categories now read as categorized. Verified: yarn nx typecheck tangle-cloud, yarn nx build tangle-cloud both green. --- apps/tangle-cloud/src/components/Header.tsx | 2 +- apps/tangle-cloud/src/components/Sidebar.tsx | 4 +- .../components/blueprints/categoryColor.ts | 74 ++++++++++ .../src/pages/blueprints/BlueprintListing.tsx | 21 +-- .../src/pages/blueprints/[id]/page.tsx | 38 ++++-- .../src/pages/blueprints/page.tsx | 14 +- .../src/pages/instances/AccountStatsCard.tsx | 7 +- .../tangle-cloud/src/pages/instances/page.tsx | 2 +- apps/tangle-cloud/src/styles.css | 129 ++++++++++-------- .../data/blueprints/fetchBlueprintsOnChain.ts | 67 ++++++++- .../src/data/graphql/useBlueprints.ts | 53 ++++++- 11 files changed, 317 insertions(+), 94 deletions(-) create mode 100644 apps/tangle-cloud/src/components/blueprints/categoryColor.ts diff --git a/apps/tangle-cloud/src/components/Header.tsx b/apps/tangle-cloud/src/components/Header.tsx index d4628e891..2ce210c05 100644 --- a/apps/tangle-cloud/src/components/Header.tsx +++ b/apps/tangle-cloud/src/components/Header.tsx @@ -53,7 +53,7 @@ export default function Header({ return (
= ({ isExpandedByDefault, onExpandedChange }) => { <>