Skip to content

[codex] diagram studio home clarity and metadata#192

Merged
anand-testcompare merged 1 commit intomainfrom
codex/diagram-studio-home-clarity
Mar 2, 2026
Merged

[codex] diagram studio home clarity and metadata#192
anand-testcompare merged 1 commit intomainfrom
codex/diagram-studio-home-clarity

Conversation

@anand-testcompare
Copy link
Copy Markdown
Collaborator

@anand-testcompare anand-testcompare commented Mar 2, 2026

Summary

This PR redesigns the diagram home/list experience to make re-entry clearer and more useful, while preserving fast access to local recents and improving source visibility for OpenCode-created sessions.

It also removes redundant home-page status badges and simplifies the signed-in header actions to match expected navigation behavior.

Problem

The previous diagrams landing experience had several usability issues:

  • The page spent too much space on explaining capabilities and too little on helping users quickly identify and reopen diagrams.
  • Sessions were difficult to distinguish because names and metadata were sparse.
  • OpenCode-created sessions were not clearly identified in the list.
  • Local recents were tracked separately in multiple places and not cleanly merged with cloud sessions.
  • The list showed many empty/blank sessions by default, reducing signal.

Root Cause

  • Session metadata model lacked first-class fields for source (sketchi vs opencode), prompt context, derived title, and diagram type.
  • Listing API returned limited summary info and no explicit “renderable/empty” signal.
  • Frontend list UI was built around generic recents rather than a unified cloud+local model with visual previews.
  • Session recents storage logic was duplicated in the diagram page.
  • Header/home UI still reflected older product-surface assumptions (API docs top-level button and status badges).

What Changed

Backend

  • Extended diagramSessions schema with session metadata:
    • title, titleEditedAt, source, firstPrompt, lastPrompt, diagramType.
    • Added index by_owner_updatedAt for list ordering.
  • Updated diagramSessions.create to accept optional source and title and normalize title input.
  • Added diagramSessions.listMine summary query with:
    • title/source/prompt context/type/version timestamps,
    • preview scene payload for top N items,
    • hasScene and hasRenderableContent to drive empty filtering.
  • Added diagramSessions.rename mutation.
  • Updated thread enqueue + node processing flow to:
    • stamp first/last prompt metadata,
    • derive default title from first prompt unless user-edited,
    • capture and persist proposed diagramType from tool output.
  • Updated oRPC diagram session creation paths to set source: "opencode" for OpenCode-origin sessions.

Frontend

  • Rebuilt /diagrams page as a focused re-entry surface:
    • unified cloud sessions + local recents,
    • default-on Hide empty filter,
    • explicit empty-state fallback and reveal action,
    • inline rename for cloud sessions,
    • source/type/context/updated/created/version metadata.
  • Added reusable diagram list components:
    • diagram-list-item.tsx
    • diagram-scene-preview.tsx (lightweight SVG preview render)
  • Added centralized local recents utility:
    • diagram-recents.ts
  • Updated /diagrams/[sessionId] page to use shared recents helper and explicit source: "sketchi" for manual new-session creation.
  • Header cleanup:
    • remove top-level API Docs nav button,
    • keep theme toggle left of auth/profile control.
  • Home page cleanup:
    • remove “Available” from Icon Library Generator card,
    • remove “Alpha” from AI Diagram Generation card,
    • keep status rendering available where needed (OpenCode plugin version label).

Visual Source Indicators

  • Added OpenCode icon assets for light/dark chips in list cards.
  • Sketchi sessions use existing logo icon in source badge.

User Impact

  • Users can reopen the right diagram faster with stronger metadata and preview context.
  • OpenCode-origin sessions are clearly labeled and no longer blend with manually created sessions.
  • Empty/blank sessions are hidden by default, reducing noise.
  • Navbar behavior is cleaner and more intuitive for signed-in usage.

Validation

Executed locally:

  • bun x ultracite fix
  • bun x ultracite check
  • bun run check-types
  • bun run build
  • cd packages/backend && bunx convex codegen && bun run test

Additional OpenCode integration validation against local app (http://localhost:3001):

  • SKETCHI_API_URL=http://localhost:3001 SKETCHI_ACCESS_TOKEN="$(cat .memory/workos-auth/local-access-token.txt)" SKETCHI_SKIP_PNG_RENDER=1 bun run --cwd packages/opencode-excalidraw test:integration
  • Scenarios for create + tweak passed with session continuity.

Notes

  • Browser automation reached intermittent agent-browser read-lock issues during WorkOS password-step interaction (os error 35), so final confidence was established through deterministic build/test/integration checks above.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sketchi-web Building Building Preview, Comment Mar 2, 2026 11:32pm

Request Review

@anand-testcompare anand-testcompare changed the title improve diagram studio home clarity and metadata [codex] diagram studio home clarity and metadata Mar 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Browserbase Replays

  • Session 999a84ac-7449-4c1c-8996-a82edbafb0f1 (scenario: visual-sanity.ts): replay | debug
  • Session c078faf0-174c-421b-9a5a-818bdbcafd4c (scenario: auth-gates.ts): replay | debug
  • Session 875c31c4-e39c-418a-854d-0475084a2d7f (scenario: opencode-web-continuity.ts): replay | debug
  • Session ee3c80b5-6136-43b6-9cfc-b8646665e14f (scenario: diagram-studio-happy-path.ts): replay | debug
  • Session 31abb38a-7702-4c07-86e5-ed8c6f540338 (scenario: diagram-studio-occ-conflict.ts): replay | debug

Workflow run: 22600754306

@anand-testcompare anand-testcompare marked this pull request as ready for review March 2, 2026 23:44
@anand-testcompare anand-testcompare merged commit ae7ef72 into main Mar 2, 2026
8 checks passed
@anand-testcompare anand-testcompare deleted the codex/diagram-studio-home-clarity branch March 2, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant