Skip to content

Promote develop → main: global error notifications + context-UX unification + Activity redesign#217

Merged
haowei2000 merged 11 commits into
mainfrom
develop
Jul 16, 2026
Merged

Promote develop → main: global error notifications + context-UX unification + Activity redesign#217
haowei2000 merged 11 commits into
mainfrom
develop

Conversation

@haowei2000

Copy link
Copy Markdown
Collaborator

Promotes 11 commits from develop to main — four PRs, frontend-only (no migrations, no backend contract changes). Everything below is verified live on the kind stack.

What ships (by theme)

Migrations

None — no new files under gateway/migrations/. No DB backup needed for this promotion.

Deploy sequencing

  1. Merge this PR.
  2. Frontend-only deploy to Hetzner (./scripts/redeploy.sh frontend equivalent, or the compose rebuild). No gateway contract changes, so gateway redeploy isn't required by this release — safe to deploy frontend alone.
  3. (Optional, maintainer's own timing) Cut connector-v0.1.28 per the sequencing note in chore(connector): bump to 0.1.28 for the workspace.read release #213.

Pre-flight checklist

  • develop CI green (CI + Main Source Gate)
  • No migrations to apply
  • No open PRs target develop besides pre-existing dependabot bumps (unrelated, not included here)
  • Frontend deploy + smoke-check session-expired takeover and Activity board in prod after merge

🤖 Generated with Claude Code

haowei2000 and others added 11 commits July 16, 2026 10:01
… release

Version bump for the connector-v0.1.28 release. The self-update gate compares
`CARGO_PKG_VERSION`, so the bump is what marks 0.1.28 as newer for opt-in updaters.

Ships (connector-side, reaches prod agents only via this release):
- injection-safe XML `<context>` prompt envelope (P1)
- remote-workspace `workspace.read` references + note pointing at the new MCP tool
- MCP `read_workspace` tool (read another bot's workspace under your own permission)

Compat: `[update]` breaks <0.1.27 configs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chore(connector): bump to 0.1.28 for the workspace.read release
…cker + tree attach

Addresses three recorded frontend issues about the context-attach UX.

#1 — Composer "Add context" only offered Plan + Recent decisions, though the
model supports more channel-scoped kinds. Broaden the quick-pick to Plan · Recent
decisions · Sessions · Cost (the target-less channel reads), and add a footer note
that files / messages / a bot's workspace files attach from their own panels
(they need a specific target).

#2a + #3 — The same act (attach a resource to the next message's context_bundle)
wore three head verbs across five surfaces ("Add context" / "Attach" / "Attach
this file|board|the selected lines"). New single source of truth
`context/contextLabels.ts`: one head verb "Add … to context", object explicit,
scope "your next message". Applied to the composer menu, RemoteWorkspace attach,
and Workbench file/board/passage. (File-UPLOAD "Attach file" left as-is — it's a
different concept, and the split now disambiguates it.)

#2b — RemoteWorkspace file tree had no attach affordance; you had to open a file
first. Add a per-row hover "add to context" button on file rows (dirs excluded),
reusing AttachContextButton + workspaceContextItem. Cheap because a workspace.read
attach is a text-only reference (bot_id + path) — no file read needed.

Labels/UX only; no behavior change. tsc (touched files) + vite build clean;
#1 verified live on kind (popover items + footer + unified button title).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/cost + preserve workspace root

Two review findings on the context-UX PR:

[P1] The composer picks reference channel.plan.read / sessions / usage, but the MCP
bridge exposed NO tool for them (also true for the pre-existing Plan pick) — so the
recipient couldn't resolve them (unknown tools reject). Add read-only MCP tools
`read_plan` / `read_sessions` / `read_cost` mapping to those verbs.

[P2] A workspace.read tree/opened-file reference recorded only the relative path;
when browsing a non-default allowed root the broker passed no root and the connector
fell back to its default cwd / first allowed root — resolving a different same-named
file or failing. Thread the browse root end-to-end:
  workspaceContextItem(root) → params.root  →  MCP read_workspace copies `root`  →
  broker_workspace_read reads it  →  read_workspace_file_as_bot → workspace_call(root).
Root is now part of the reference identity (same path under two roots ≠ same chip).

Builds + tests green (MCP, gateway, frontend vitest incl. new root case).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(context): unify "add to context" vocabulary + broaden composer picker + tree attach
Rebuild the Activity board's presentation for multi-user / multi-bot
channels (data layer activityEpisodes.ts untouched):

- Flow list replaces the rail+detail two-pane: one line per episode —
  relay-chain avatars (trigger human → the bots involved), trigger
  excerpt, time — newest auto-expanded inline on an indigo tint.
- Expanded detail hangs message rows on a left rule: sender names in
  lightened brand colors (color-mix), consecutive writes/approvals fold
  into one muted line, hover swaps the timestamp for a jump arrow that
  scrolls the chat to the original message; @mentions highlight inline.
- Participant strip: recency-ordered avatar stack with presence dots and
  online count; clicking spotlights one member via the shared filter.
- Avatar gains an opt-in `online` presence-dot prop (DESIGN.md §2.7);
  MemberFilter migrates to the shared PopoverPanel/usePopoverDismiss;
  new §2.16 avatar-stack recipe documented in DESIGN.md.
- Lenses: Flow / Highlights / All (All renders every episode expanded);
  long episode spans format as h/d instead of thousands of minutes.

Verified live against the kind stack (typecheck clean; zero console
errors; jump/hover/filter/lens flows screenshot-verified).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…el-redesign-b63f50

feat(viewboard): redesign Activity as a collaboration flow list
…rBoundary, Banner/ErrorState/notify tiers

Errors were toast-only (87 sites) with no M/L tiers: an expired token
stranded the user on a page looping 401 toasts, render crashes blanked
the app, and a dropped websocket froze silently.

Three-tier system (documented in DESIGN.md §2.16):
- P0 session expiry: api client classifies 401s (non-/auth/*, token
  present) into authStore.sessionExpired; App renders a full-screen
  "Session expired" takeover whose Sign-in-again round-trips through
  /login?redirect=…; RequireAuth now preserves the redirect too. WS
  auth_err flips the same flag and stops reconnecting with a dead token.
- P0 crashes: top-level ErrorBoundary → ErrorState (Reload + copy details).
- P1 tier components: ui/banner.tsx (soft status strip) and
  ui/error-state.tsx (panel/full-page error canon); useChatRealtime
  exposes status/reconnectNow driving a debounced "Connection lost"
  banner in ChannelView; ChatLayout bootstrap panel, ChannelView load
  error and WorkbenchManager strip now use the shared components.
- P2: lib/notify.tsx semantic toasts with an optional action; 23
  toast.error(String(e)) sites → notify.error(messageOf(e)) so
  humanized ApiError messages stop degrading; ErrorDialog optional action.

Verified end-to-end on the kind stack (headless Chrome): corrupt token →
takeover → sign in → redirected back; killed gateway → banner →
retry-while-down persists → auto-clears on restore. Two race fixes came
out of e2e: navigate-before-logout (RequireAuth's <Navigate> was
clobbering ?redirect=) and takeover z-index above the Toaster.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The three-tier design spec (live demos per tier, status→tier decision
table, adoption inventory) previously lived only as a hosted artifact;
docs/design/ERROR_NOTIFICATIONS.html makes it reviewable offline and
versioned with the code. DESIGN.md §2.16 (en + zh) now links to it.
Header comment documents the ?only=/?demo= params used for automated
screenshots.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
develop's Activity redesign (c9a2e89) also claimed §2.16 (avatar
stack); it's already merged, so the error-notifications section yields
and becomes §2.17. All cross-references updated (anti-pattern checklist,
zh mirror, mockup header).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ions-814365

feat(frontend): global error-notification system — 401 takeover, ErrorBoundary, three-tier Banner/ErrorState/notify
@haowei2000
haowei2000 merged commit 5400cae into main Jul 16, 2026
11 checks passed
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