webui: fix mobile UI displaying subconversations
Fix mobile UI incorrectly showing subconversations (messages with parent_conversation_id)
that should be hidden like in the regular UI to maintain consistent behavior across
all interfaces.
Problem Analysis:
The mobile UI was displaying all messages including subconversations, while the regular
desktop UI correctly filters out messages with hide_output=true. This created an
inconsistent user experience where subconversations (used for internal agent processing)
were visible in the mobile interface but hidden in the desktop interface.
Subconversations are marked with hide_output=true based on conversation.Hidden when
the message's conversation has a parent conversation. These are internal processing
messages that shouldn't be shown to users in either interface.
Implementation Changes:
1. Mobile Chat Filtering Enhancement:
- Modified shouldShowMessage() method in mobile-chat.ts
- Added hide_output check at start of filtering logic
- Returns false immediately for any message with hide_output=true
- Mirrors the filtering logic used in sketch-timeline.ts (.filter((msg) => !msg.hide_output))
2. Consistent Filtering Logic:
- Mobile UI now matches regular UI filtering behavior
- Preserves existing content and type filtering for visible messages
- Maintains all other message display logic unchanged
- Uses same pattern as desktop: early return false for hidden messages
Technical Details:
- hide_output field is set based on conversation.Hidden in AgentMessage.SetConvo()
- Subconversations have parent_conversation_id and are marked as hidden
- Regular UI filters with messages.filter((msg) => !msg.hide_output)
- Mobile UI now filters with if (message.hide_output) { return false; }
- No changes needed to aggregateAgentMessages as filtering happens at display level
Benefits:
- Consistent user experience across desktop and mobile interfaces
- Proper hiding of internal agent processing messages
- Clean mobile chat interface without subconversation clutter
- Maintains all existing mobile UI functionality for visible messages
Testing:
- TypeScript compilation passes without errors
- Filtering logic matches pattern used successfully in desktop UI
- Mobile chat component is only message rendering location in mobile UI
- Change isolated to display filtering without affecting message aggregation
This fix ensures mobile users see the same clean conversation view as desktop
users, with internal agent subconversations properly hidden from the interface.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s40a49bd924bde7e2k
diff --git a/webui/src/web-components/mobile-chat.ts b/webui/src/web-components/mobile-chat.ts
index 52d9002..c746686 100644
--- a/webui/src/web-components/mobile-chat.ts
+++ b/webui/src/web-components/mobile-chat.ts
@@ -283,6 +283,11 @@
}
private shouldShowMessage(message: AgentMessage): boolean {
+ // Filter out hidden messages (subconversations) like the regular UI does
+ if (message.hide_output) {
+ return false;
+ }
+
// Show user, agent, and error messages with content
return (
(message.type === "user" ||