web: surface ui/message and app logging in panels below the running app#1658
web: surface ui/message and app logging in panels below the running app#1658cliffhall wants to merge 4 commits into
Conversation
AppRenderer: - New `onMessage` prop backs an `onmessage` bridge handler that surfaces the view's ui/message content and returns the spec-required empty result; with no handler the submission is declined (isError). - New `onLog` prop forwards MCP `notifications/message` log entries via the bridge `loggingmessage` event, honoring the advertised `logging` capability. AppsScreen: - Adds `messages`/`appLogs` state (cleared with the reported height on select/open/close/back via resetAppChannels) and `handleMessage`/`handleLog`. - Renders a "Messages from app" panel (data-testid="apps-messages", reusing ContentViewer) and a default-expanded collapsible "App logs" panel (data-testid="apps-logs", reusing LogLevelBadge) with logger names and a Clear button, both as pinned panels below the running widget. Adds AppRenderer tests (log forward + no-handler no-throw, ui/message route/empty-result/decline) and AppsScreen tests (message log render + empty result + clear-on-close, log panel expand/collapse/clear). Closes #1570 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
# Conflicts: # clients/web/src/components/screens/AppsScreen/AppsScreen.tsx
|
@claude review |
|
Claude finished @cliffhall's task in 3m 42s —— View job PR Review — surface
|
…1658) Address the claude[bot] review: - #1 (applied): formatLogData coalesces JSON.stringify(undefined) → "" so the `: string` return type is honest for a data-less log. - #2 (applied): cap retained messages/logs at MAX_APP_CHANNEL_ENTRIES (500) via appendCapped — a chatty widget no longer grows the panels/DOM without bound between Clear/close; oldest entries drop. - #3 (declined): keep the Messages panel without a Clear/collapse — messages are sparser and already cleared on close/switch; keeping it simple. - #4 (applied): the App-logs toggle now has aria-controls pointing at the Collapse region (id="apps-logs-region") for assistive tech. Adds tests: no-data log renders (coalesce branch), 501 logs cap at 500 (oldest dropped), aria-controls assertion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
Thanks — LGTM appreciated. Addressed the polish items in 0190220: 1. 2. Unbounded 3. Panel affordance asymmetry (Messages has no Clear/collapse) — declined, with reason. Kept intentionally: messages are typically far sparser than logs, and the panel is already cleared on close/switch (and now capped). Adding a second Clear/collapse pair felt like noise for the common case. Easy to revisit if noisy-message widgets show up. 4. A11y
|
|
@claude review |
|
Claude finished @cliffhall's task in 1m 13s —— View job Re-review — follow-up commit
|
Address the round-2 nit: give AppMessage a stable `id` (assigned via nextMessageIdRef in handleMessage) and key the Messages panel on it instead of the array index — so the appendCapped front-drop can't renumber keys once a run exceeds the cap, matching AppLogEntry's treatment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
|
Applied the round-2 nit in a follow-up: |
Closes #1570
Surfaces two view→host message streams below the running widget (re-implementation of the relevant slice of PR #1510).
Changes
AppRenderer
onMessageprop backs anonmessagebridge handler that surfaces the view'sui/messagecontent and returns the spec-required empty result (no conversation leak); with no handler the submission is declined (isError).onLogprop forwards MCPnotifications/messagelog entries via the bridgeloggingmessageevent, honoring the advertisedloggingcapability.AppsScreen
messages/appLogsstate (cleared with the reported height viaresetAppChannelson select/open/close/back) andhandleMessage/handleLog.data-testid="apps-messages", reusingContentViewer) and a default-expanded collapsible App logs panel (data-testid="apps-logs", reusingLogLevelBadge) with logger names and a Clear button — both pinned below the running widget. All new subcomponents are.withProps()constants; no inline styles / raw colors.Tests
npm run cipasses locally.Stacking
Stacked on #1569 (
v2/1569-download-file). Merge order: #1565 → #1566 → #1567 → #1568 → #1569 → this.🤖 Generated with Claude Code
https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw