Fix/trace and UI improvements#27
Open
muhammad-bassiouni wants to merge 2 commits intoownpilot:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Trace Rendering Crash & Sidebar UI Aesthetics
1. Trace Rendering Crash (
TypeError: Cannot read properties of undefined)The Issue
Opening historical chats or expanding the Trace module during active sessions caused the frontend to completely crash with a React Error Boundary:
TypeError: Cannot read properties of undefined (reading 'reduce') at TraceDisplay.How to Reproduce Exactly
TraceDisplay.tsxattempts to call.reduce()or.map()onundefinedtrace arrays (e.g.,trace.autonomyChecks.reduce()).The Fix Applied
Instead of patching the UI with endless defensive checks (e.g.,
trace.autonomyChecks || []), we enforced a strict backend contract.autonomyChecks,dbOperations,memoryOps,triggersFired,errors) with safe defaults when streaming trace data back to the UI.normalizeTrace()interceptor to the history API to sanitize legacy database records before they are sent to the client.How it Solves the Issue
The frontend is now guaranteed to receive a perfectly formatted
TraceInfoobject directly from the API. By fixing the data structure at the source (the gateway/database extraction layer),TraceDisplay.tsxcan safely iterate over arrays without risking null reference crashes.Files Changed
packages/gateway/src/services/conversation-service.tspackages/gateway/src/routes/chat-history.tspackages/ui/src/components/TraceDisplay.tsx2. Sidebar UI Aesthetics & Indentation
The Issue
The main sidebar UI felt slightly unpolished and bulky. Nested lists inside accordions (Workspaces, Workflows, Recent Chats) had incorrect indentation, making it hard to see the visual hierarchy. Active navigation items relied on heavy left borders. The "Recent" search input lacked an icon and was flush with the far edge, disconnecting it from its header.
How to Reproduce Exactly
border-l-[3px]active state and the jumping text effect (hover:translate-x-0.5).\u2026instead of an actual Search icon.The Fix Applied
pl-7for standard lists,pl-9for Recent search/tabs) so the text of child items perfectly aligns vertically with the text of their parent headers.bg-primary/10).text-sm font-mediumfor nav links andtext-[13px]for deeper nested items.Searchicon into the recent input, softened its background tobg-black/5, and replaced the generic Customize chevron with theSettings2icon.How it Solves the Issue
The sidebar now adheres to modern, professional UI standards. The spatial hierarchy is clear because child elements physically nest under their parent text. Active elements are obvious without being heavy, and the components look fully integrated rather than patched together.
Files Changed
packages/ui/src/components/Sidebar.tsxpackages/ui/src/components/sidebar/SidebarDataSection.tsx