Skip to content

Add chat history panel and analytics UX improvements#738

Open
katyaogai73 wants to merge 14 commits into
mainfrom
ai_main_7ffabcb294014e4aa31e
Open

Add chat history panel and analytics UX improvements#738
katyaogai73 wants to merge 14 commits into
mainfrom
ai_main_7ffabcb294014e4aa31e

Conversation

@katyaogai73
Copy link
Copy Markdown

@katyaogai73 katyaogai73 commented May 17, 2026

Summary

Adds a chat history tab to the agent panel that lets users browse and reopen previous conversations. Also ships several analytics UX improvements including visibility indicators, SQL syntax highlighting, an org-shared overview page, and author/date metadata on dashboards and analyses.

Problem

Users had no way to reference or return to previous AI conversations from within the chat panel. Additionally, dashboards and analyses lacked visibility status indicators, metadata (author, last updated), and a centralized place to discover org-shared content.

Key Changes

  • Chat history panel: Added a History tab in the agent panel header showing a searchable list of previous conversations; clicking a thread dispatches an agent-panel:open-thread custom event that switches the active chat thread in MultiTabAssistantChat
  • SQL syntax highlighting: New SqlHighlight component with a custom tokenizer that color-codes keywords, functions, strings, comments, numbers, operators, and template variables
  • Visibility indicators: Color-coded dots (yellow = private, blue = org, green = public) added to sidebar items and within dashboard/analysis detail views
  • Overview page: New OverviewPage replaces the old Index route, displaying a grid of org-shared dashboards and analyses sorted by recency
  • Metadata on dashboards: createdAt and updatedAt fields now returned from the SQL dashboard API handler; author and last-updated info surfaced in the UI
  • Sidebar enhancements: Added copy-link, set-visibility, and filter controls to sidebar rows for dashboards and analyses

Edit in Builder  Preview


To clone this PR locally use the Github CLI with command gh pr checkout 738

You can tag me at @BuilderIO for anything you want me to fix or change

@builder-io-integration builder-io-integration Bot changed the title Update from the Builder.io agent Add chat history panel and analytics UX improvements May 17, 2026
Copy link
Copy Markdown
Contributor

@builder-io-integration builder-io-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 3 potential issues 🔴

Review Details

Code Review Summary

I've reviewed the changes across 984 additions in PR #738. This PR adds a chat history panel, SQL syntax highlighting, visibility indicators, an overview page, and enhanced dashboard/analysis metadata. The overall architecture is sound — feature additions follow agent-native patterns with proper state management, React Query integration, and UI composition.

Key Findings

🔴 HIGH-severity issues (1):

  • Missing updatedAt in listSqlDashboards — The PR adds createdAt and updatedAt to getSqlDashboard (good), but the new OverviewPage expects all shared items to have updatedAt for sorting/filtering. The listSqlDashboards handler was not updated to include these fields. Result: org-shared dashboards never appear on /overview (all filtered out by filter((i) => i.updatedAt) at line 84 of OverviewPage).

🟡 MEDIUM-severity issues (1):

  • Incomplete cache rollback in visibility mutations — The handleAnalysisSetVisibility function optimistically updates two React Query cache keys (analyses-sidebar and analyses-list) but only restores one on error, leaving the list cache in an inconsistent state. Additionally, there's a query-key mismatch: optimistic updates target ['analyses-sidebar'] but the subscribed queries use ['analyses-sidebar', analysesSync], so optimistic updates may not be visible until the next refetch.

What Passed Review

Security & data access — SQL syntax highlighting is display-only with no injection risk; overview page fetches through properly scoped API handlers with accessFilter
Event handling — New agent-panel:open-thread listener includes proper cleanup function
Component patterns — SqlHighlight component is well-structured; sidebar visibility toggles follow established UI patterns
Feature scope — Changesets file correctly declares "@agent-native/core": minor

Risk Assessment

Standard Risk — UI/business logic changes with no auth, payment, or breaking API impact. Visibility controls follow existing shared-resource patterns (ownableColumns). No schema changes beyond additive fields.

🧪 Browser testing: Will run after this review (PR touches UI code and modifies rendered sidebar/overview page).

Comment thread templates/analytics/app/pages/overview/OverviewPage.tsx
Comment thread templates/analytics/app/components/layout/Sidebar.tsx Outdated
Comment thread templates/analytics/app/components/layout/Sidebar.tsx
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

@cloudflare-workers-and-pages

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@builder-io-integration builder-io-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual Verification

Browser testing: 11/14 passed, 1 failed

Test Results: 11/14 passed ⚠️

✅ TC-01: Overview page loads and shows empty state for no shared content (succeeded)

Steps: Logged in to analytics, navigated to /analytics/overview, waited for empty-state text, captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics, http://127.0.0.1:8080/analytics/overview

Evidence: 1 screenshot captured

✅ TC-02: Visibility dots in sidebar show yellow for private items with tooltip (succeeded)

Steps: Navigated to /analytics/overview, expanded Dashboards and Analyses sidebar sections, hovered dashboard row, verified Private-labeled dot elements in DOM, captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 1 screenshot captured

✅ TC-03: Analyses list search filters results in real-time (succeeded)

Steps: Navigated to /analytics/analyses, typed "Prefetch" in search field (card remained), typed "zzznomatch" (no-results state appeared), captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics/analyses

Evidence: 1 screenshot captured

⚠️ TC-04: SQL syntax highlighting renders colored tokens in ViewSqlPopover (couldnt_verify)

Steps: Navigated to /analytics/adhoc/test-prefetch-dashboard, waited 15s for View SQL, tried fallback /adhoc/second-test-dashboard, both returned empty dashboard state.

Failure: feature_not_reachable — Dashboards /adhoc/test-prefetch-dashboard and /adhoc/second-test-dashboard loaded as empty dashboards with no SQL panels — View SQL button unreachable.

URLs tested: http://127.0.0.1:8080/analytics/adhoc/test-prefetch-dashboard, http://127.0.0.1:8080/analytics/adhoc/second-test-dashboard

Evidence: 1 screenshot captured

✅ TC-05: Overview page empty-state copy is accurate and complete (succeeded)

Steps: Navigated to /analytics/overview, verified empty-state card content including icon, heading, and descriptive text, captured full-page screenshot.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 1 screenshot captured

✅ TC-06: Sidebar "Filter by org-shared" toggle filters dashboard list (succeeded)

Steps: Logged in, navigated to /analytics/overview, captured pre-toggle screenshot with both dashboards visible, clicked "Filter by org-shared", captured post-toggle screenshot showing empty sidebar dashboard list.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 2 screenshots captured

✅ TC-07: Sidebar ⋯ menu on a dashboard item shows "Copy link" option (succeeded)

Steps: Logged in, navigated to /analytics/overview, hovered "Second Test Dashboard", clicked the ⋯ actions button, verified "Copy link" in dropdown, captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 1 screenshot captured

✅ TC-08: "Share with org" / "Make private" visibility toggle via sidebar menu (succeeded)

Steps: Opened ⋯ menu on "Second Test Dashboard", clicked "Share with org", confirmed blue dot, captured screenshot, then restored to private via same menu and confirmed yellow dot.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 2 screenshots captured

❌ TC-09: Dashboard detail shows metadata (author, updated date, visibility indicator) (failed)

Steps: Logged in, navigated to /analytics/adhoc/test-prefetch-dashboard, waited 15s, tried fallback /adhoc/second-test-dashboard, neither showed metadata in DOM or UI.

Failure: assertion_failed — Both /adhoc/test-prefetch-dashboard and /adhoc/second-test-dashboard loaded as "Empty Dashboard" state — no panels or metadata header rendered after 15s wait.

URLs tested: http://127.0.0.1:8080/analytics/adhoc/test-prefetch-dashboard, http://127.0.0.1:8080/analytics/adhoc/second-test-dashboard

Evidence: 1 screenshot captured

⚠️ TC-10: Dispatch — "All chats" history button opens history panel in agent sidebar (couldnt_verify)

Steps: Navigated to /dispatch, filled sign-in form with test@example.com / testpassword123, submitted, received "Invalid email or password", authenticated sidebar unreachable.

Failure: creds_missing — Dispatch uses a separate user database from Analytics — the test account created in Analytics does not exist in Dispatch's DB, so login failed.

URLs tested: http://127.0.0.1:8080/dispatch

Evidence: 1 screenshot captured

✅ TC-11: Analyses search shows "no results" empty state for unmatched query (succeeded)

Steps: Navigated to /analytics/analyses, confirmed existing card, typed unmatched query, waited 1s, verified and captured empty state screenshot.

URLs tested: http://127.0.0.1:8080/analytics/analyses

Evidence: 2 screenshots captured

✅ TC-12: Visibility dot tooltip shows correct label on hover ("Private" / "Shared with org" / "Public") (succeeded)

Steps: On /analytics/analyses, hovered visibility dot next to the analysis sidebar item, waited for tooltip, captured screenshot showing "Private" tooltip.

URLs tested: http://127.0.0.1:8080/analytics/analyses

Evidence: 1 screenshot captured

✅ TC-13: SQL highlighting renders template variables {{var}} in orange (succeeded)

Steps: Seeded explorer autosave config, navigated to /analytics/adhoc/explorer, expanded SQL Query section, verified highlighted tokens including {{dateStart}} variable, captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics/adhoc/explorer

Evidence: 1 screenshot captured

✅ TC-14: Overview page sorts shared items by most recently updated (regression) (succeeded)

Steps: Shared both dashboards via sidebar ⋯ menu, stamped updatedAt timestamps (prefetch newer), reloaded /analytics/overview, verified card order and captured screenshot.

URLs tested: http://127.0.0.1:8080/analytics/overview

Evidence: 1 screenshot captured

Details

PR #738 coverage: 11/14 TCs passed, 1 failed, 2 couldn't verify. All analytics features (visibility dots, overview page, search, SQL highlighting, sidebar controls, sharing) verified working. One regression found: dashboard metadata header not rendered on detail pages (TC-09). Two TCs blocked: SQL ViewSqlPopover unreachable due to empty dashboards (TC-04 — SQL highlighting verified via Explorer instead by TC-13); Dispatch chat history inaccessible due to separate user DB (TC-10).

- listSqlDashboards: include updatedAt/createdAt in list response so
  OverviewPage can sort/display dashboard cards correctly
- handleDashboardSetVisibility: use getQuerySnapshots/setQueriesData for
  prefix-key matching (fixes optimistic updates with sync-versioned keys)
- handleAnalysisSetVisibility: use getQuerySnapshots for both sidebarKey
  and listKey; restore both on error (fixes incomplete rollback bug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants