Skip to content

feat: overhaul BrainBar dashboard UX#246

Merged
EtanHey merged 9 commits into
mainfrom
feat/brainbar-ux-overhaul
Apr 17, 2026
Merged

feat: overhaul BrainBar dashboard UX#246
EtanHey merged 9 commits into
mainfrom
feat/brainbar-ux-overhaul

Conversation

@EtanHey
Copy link
Copy Markdown
Owner

@EtanHey EtanHey commented Apr 16, 2026

Summary

  • split dashboard throughput into explicit Indexing and Enriching rows with digit-stable metrics, recent-rate fallback, and right-aligned numeric layout
  • stop fake-zero enrichment speeds by falling back to recent throughput when the instantaneous window drops to zero, and stop popover drift by avoiding redundant same-size resize requests across tab switches
  • fix follow-on review issues in the branch: restart-safe InjectionStore, real popover-size regression coverage, and build-app.sh socket verification only when the LaunchAgent is actually installed

Test plan

  • swift test --package-path brain-bar --filter 'BrainBarUXLogicTests|InjectionStoreTests|PopoverTabTests|StabilityFixTests'
  • bash brain-bar/build-app.sh

Verification notes

  • The focused BrainBar dashboard/popover/injection tests above passed on commit 638671e5.
  • swift test --package-path brain-bar is still red on this branch because of pre-existing knowledge-graph test failures/crashes outside this UX slice (KGDatabaseTests assertions and a KGViewModelTests index-out-of-range crash).

Note

Overhaul BrainBar dashboard UX with pipeline indicators, activity tracks, and conversation drill-down

  • Redesigns the dashboard popover to a unified 560×520 panel with pipeline status badges (PipelineIndicatorBadgeView), a Speed metric tile, and two activity rows (PipelineActivityRowView) showing per-track sparklines and rate/detail strings; removes the old inline sparkline and Refresh button.
  • Adds DashboardMetricFormatter and PipelineState models (PipelineIndicators, PipelineActivityTracks) to compute and format indexing/enriching rates, statuses, and bucket-based sparkline data.
  • Extends BrainDatabase with enrichment rate and bucket queries, a typed ExpandedConversation model, and a Darwin notification posted on injection insert; InjectionStore is rewritten to use polling + Darwin notifications instead of GRDB ValueObservation.
  • Adds conversation drill-down throughout the UI: the injection feed and knowledge graph sidebar now let users open a ChunkConversationSheet displaying role, timestamp, and content for a chunk's conversation history.
  • Hardens build-app.sh to deterministically stop the LaunchAgent, wait for process exit, clean up the socket, and verify connectivity after bootstrapping.
  • Behavioral Change: the status bar sparkline now renders from recentEnrichmentBuckets instead of recentActivityBuckets.

Macroscope summarized 99a0d6d.


Note

Medium Risk
Touches multiple runtime-critical paths (SQLite stats queries, injection event persistence/ordering, and socket write/backpressure handling) plus a sizable dashboard UI refactor, so regressions could affect live status rendering and client connectivity.

Overview
Dashboard UX overhaul: the popover is redesigned into a stable 560×520 utility panel with new pipeline indicator badges and separate Indexing/Enriching activity rows (each with its own sparkline), plus a new Speed metric and digit-stable formatting via DashboardMetricFormatter.

New enrichment telemetry: BrainDatabase.DashboardStats now includes recentEnrichmentBuckets and enrichmentRatePerMinute, with new SQL helpers to bucket by enriched_at and compute a short-window completion rate; the menu-bar sparkline is switched to render enrichment activity.

Conversation thread viewing: adds typed ExpandedConversation/ConversationChunk models and expandedConversation(...), introduces ChunkConversationSheet, and wires injection events and KG sidebar chunk links to open the surrounding thread for a selected chunk.

Data + reliability fixes: InjectionStore is rewritten to use BrainDatabase + Darwin notifications/data-version polling (removing GRDB observation), injection events use deterministic ordering (timestamp DESC, id DESC) and only post change notifications on successful insert, popover resizing is guarded to prevent drift, socket backpressure tests are expanded/cleaned up, and build-app.sh now safely stops the LaunchAgent and verifies socket recreation only when the agent is installed.

Reviewed by Cursor Bugbot for commit 99a0d6d. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added pipeline status indicators for indexing and enriching operations with rate metrics
    • Added ability to view conversations with surrounding context for indexed chunks
    • New enrichment tracking with rate display and activity history
  • Bug Fixes

    • Fixed unnecessary popover resizing when content size unchanged
    • Improved socket handling for stalled client connections
  • Improvements

    • Redesigned dashboard layout with enhanced activity tracking visualization
    • Enhanced sparkline rendering with grid lines and improved styling

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4ce0fdb9-b7d3-487f-8173-936d8f119768

📥 Commits

Reviewing files that changed from the base of the PR and between 58e0948 and 99a0d6d.

📒 Files selected for processing (24)
  • brain-bar/Sources/BrainBar/BrainBarApp.swift
  • brain-bar/Sources/BrainBar/BrainBarServer.swift
  • brain-bar/Sources/BrainBar/BrainDatabase.swift
  • brain-bar/Sources/BrainBar/Dashboard/DashboardMetricFormatter.swift
  • brain-bar/Sources/BrainBar/Dashboard/PipelineState.swift
  • brain-bar/Sources/BrainBar/Dashboard/SparklineRenderer.swift
  • brain-bar/Sources/BrainBar/Dashboard/StatsCollector.swift
  • brain-bar/Sources/BrainBar/Dashboard/StatusPopoverView.swift
  • brain-bar/Sources/BrainBar/InjectionFeedView.swift
  • brain-bar/Sources/BrainBar/InjectionStore.swift
  • brain-bar/Sources/BrainBar/KnowledgeGraph/KGCanvasView.swift
  • brain-bar/Sources/BrainBar/KnowledgeGraph/KGSidebarView.swift
  • brain-bar/Sources/BrainBar/KnowledgeGraph/KGViewModel.swift
  • brain-bar/Sources/BrainBar/Models/EntityCard.swift
  • brain-bar/Sources/BrainBar/Views/Components/ChunkConversationSheet.swift
  • brain-bar/Tests/BrainBarTests/BrainBarUXLogicTests.swift
  • brain-bar/Tests/BrainBarTests/ChunkConversationTests.swift
  • brain-bar/Tests/BrainBarTests/DashboardTests.swift
  • brain-bar/Tests/BrainBarTests/DatabaseTests.swift
  • brain-bar/Tests/BrainBarTests/InjectionStoreTests.swift
  • brain-bar/Tests/BrainBarTests/PopoverTabTests.swift
  • brain-bar/Tests/BrainBarTests/SocketIntegrationTests.swift
  • brain-bar/Tests/BrainBarTests/StabilityFixTests.swift
  • brain-bar/build-app.sh

📝 Walkthrough

Walkthrough

This PR introduces enrichment pipeline tracking to the dashboard with new metrics and UI components, extends BrainDatabase with typed conversation structures and enrichment statistics, refactors InjectionStore to use Darwin notifications and polling, updates knowledge graph sidebar for conversation browsing, improves popover sizing behavior, and adds comprehensive test coverage.

Changes

Cohort / File(s) Summary
Enrichment Metrics & Rate Display
Dashboard/DashboardMetricFormatter.swift, Dashboard/PipelineState.swift
Added DashboardMetricFormatter enum with rate-unit selection logic (per-second/minute/hour) and formatting helpers. Introduced PipelineIndicatorStatus, PipelineIndicator, PipelineIndicators, PipelineActivityTrack, and PipelineActivityTracks types to derive pipeline statuses and activity details from daemon health and dashboard stats, including enrichment rate computation and windowed activity tracking.
Dashboard Stats & Collection
BrainDatabase.swift, Dashboard/StatsCollector.swift
Extended DashboardStats with enrichmentRatePerMinute and recentEnrichmentBuckets. Added dashboardStats(...) computation logic for enrichment metrics using time-windowed queries on enriched_at. Introduced shared recentBuckets(...) helper for parameterized bucket aggregation. Updated StatsCollector initialization to include new enrichment fields.
Conversation Expansion API
BrainDatabase.swift, Views/Components/ChunkConversationSheet.swift, Models/EntityCard.swift
Added typed structures ConversationChunk and ExpandedConversation (both Identifiable). Added expandedConversation(id:before:after:) method returning typed structures. Changed expandChunk(...) payload structure to include before_context, after_context, and merged context. Added EntityCard.Relation.displayText computed property with direction-aware formatting and default direction parameter.
Injection Event Management
BrainDatabase.swift, DatabaseTests.swift
Refactored recordInjectionEvent(...) to check sqlite3_step result and post dashboard notification only on SQLITE_DONE. Updated listInjectionEvents(...) ordering to use timestamp DESC, id DESC. Changed calls from throwing to non-throwing in tests.
Popover UI Redesign
StatusPopoverView.swift, Dashboard/SparklineRenderer.swift, BrainBarApp.swift
Redesigned dashboard tab with pipeline-focused layout replacing activity-bucket display with PipelineIndicator badges and PipelineActivityTrack rows. Updated popover size from 620×500 to 560×520. Added size-change guard to prevent redundant popover resizing. Enhanced SparklineRenderer with color-based overload, compact layout mode, grid lines, and area fill under sparkline.
InjectionStore Polling & Notifications
InjectionStore.swift, InjectionFeedView.swift, InjectionStoreTests.swift
Replaced GRDB ValueObservation with custom polling (250ms interval) and Darwin notification observer. Added version-driven refresh logic. Introduced InjectionStoreObserverBox for weak reference tracking. Added expandedConversation(...) wrapper. Updated InjectionFeedView to use observed InjectionStore, added expand/collapse per-event UI with conversation sheet presentation and error alerts.
Knowledge Graph Integration
KnowledgeGraph/KGCanvasView.swift, KnowledgeGraph/KGSidebarView.swift, KnowledgeGraph/KGViewModel.swift
Added onOpenConversation callback to KGSidebarView with per-chunk "Open" button. Added selectedConversation state and openConversation(chunkID:) method to KGViewModel. Wired conversation sheet presentation in KGCanvasView. Refactored chunk preview rendering with index-based iteration and helper text formatters.
Server & Lifecycle
BrainBarServer.swift, build-app.sh
Modified flushPendingWrites(...) to copy onDelivered handler before removal, ensuring correct callback invocation. Enhanced build script with LaunchAgent lifecycle helpers (bootout_launchagent, wait_for_brainbar_exit, wait_for_socket), configurable paths, explicit agent shutdown, and socket readiness verification with Python connection test.
Test Coverage
BrainBarTests/BrainBarUXLogicTests.swift, BrainBarTests/ChunkConversationTests.swift, BrainBarTests/DashboardTests.swift, BrainBarTests/PopoverTabTests.swift, BrainBarTests/SocketIntegrationTests.swift, BrainBarTests/StabilityFixTests.swift, BrainBarTests/DatabaseTests.swift, BrainBarTests/InjectionStoreTests.swift
Added comprehensive test suite for pipeline state/activity derivation, metric formatting (rate unit selection, non-finite handling), conversation expansion with before/after context, enrichment bucket tracking, popover size stability, Darwin notification retention, socket backpressure handling, and InjectionStore lifecycle (start/stop/restart, expanded conversation loading, Darwin refresh semantics).

Sequence Diagram(s)

sequenceDiagram
    participant Dashboard as Dashboard UI
    participant Collector as StatsCollector
    participant DB as BrainDatabase
    participant Daemon as DaemonHealthMonitor
    
    Dashboard->>Collector: observe `@Published` stats
    Collector->>Daemon: getDaemonHealth()
    Daemon-->>Collector: DaemonHealthSnapshot
    Collector->>DB: dashboardStats()
    DB->>DB: compute enrichmentRatePerMinute<br/>compute recentEnrichmentBuckets
    DB-->>Collector: DashboardStats
    Collector->>Collector: `@Published` stats updated
    Dashboard->>Dashboard: derive PipelineIndicators<br/>derive PipelineActivityTracks
    Dashboard->>Dashboard: render pipeline badges<br/>render activity rows
Loading
sequenceDiagram
    participant User as User Interaction
    participant InjectionFeed as InjectionFeedView
    participant Store as InjectionStore
    participant DB as BrainDatabase
    participant Sheet as ChunkConversationSheet
    
    User->>InjectionFeed: tap expand button
    InjectionFeed->>InjectionFeed: toggle expandedEventIDs
    User->>InjectionFeed: tap chunk Open button
    InjectionFeed->>Store: expandedConversation(chunkID:)
    Store->>DB: expandedConversation(id:)
    DB->>DB: query before_context + target + after_context
    DB-->>Store: ExpandedConversation typed result
    Store-->>InjectionFeed: ExpandedConversation
    InjectionFeed->>InjectionFeed: set selectedConversation
    InjectionFeed->>Sheet: present ChunkConversationSheet
    Sheet->>Sheet: render conversation entries<br/>with role/timestamp/summary
Loading
sequenceDiagram
    participant System as Darwin Notification
    participant Store as InjectionStore
    participant PollingTask as Polling Task
    participant DB as BrainDatabase
    
    PollingTask->>Store: start(sessionID:)
    Store->>Store: install Darwin observer<br/>launch repeating pollTask
    loop Every 250ms
        PollingTask->>DB: dataVersion()
        DB-->>PollingTask: version
        alt Version changed
            PollingTask->>DB: listInjectionEvents()
            DB-->>PollingTask: [InjectionEvent]
            PollingTask->>Store: update `@Published` events
        end
    end
    System->>Store: Darwin notification fired
    Store->>Store: dispatch refresh(force: false)
    Store->>DB: dataVersion() & listInjectionEvents()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • feat: implement all 6 BrainBar stub tools #135: Modifies chunk expansion API and payload structure returned by expandChunk(...); this PR changes the payload shape further and adds typed ConversationChunk/ExpandedConversation structures with a new expandedConversation(...) method.
  • fix: relation direction tracking in BrainBar entity display #194: Adds direction parameter and display logic to EntityCard.Relation; this PR implements displayText computed property using the direction to determine relation text order.
  • feat: add BrainBar dashboard popover #136: Extends BrainDatabase dashboard stats computation and modifies StatusPopoverView/SparklineRenderer dashboard rendering; this PR continues by adding enrichment metrics, completely redesigning the dashboard UI with pipeline-state components, and refactoring SparklineRenderer.

Poem

🐰 Enrichment tracks now sparkle bright,
Conversations bubble into sight,
Pipelines hum with Darwin's call,
Dashboard blooms—best update of all!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/brainbar-ux-overhaul

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@EtanHey
Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

@codex review

@EtanHey
Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

@cursor @BugBot review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 16, 2026

You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor

Comment thread brain-bar/build-app.sh
Comment thread brain-bar/Sources/BrainBar/Dashboard/StatusPopoverView.swift
Comment thread brain-bar/Tests/BrainBarTests/PopoverTabTests.swift Outdated
Comment thread brain-bar/Tests/BrainBarTests/InjectionStoreTests.swift
Comment thread brain-bar/Sources/BrainBar/Dashboard/StatusPopoverView.swift
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: caa7e9e726

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread brain-bar/Sources/BrainBar/InjectionStore.swift
Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

@codex review

Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

@coderabbitai review

Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

@cursor @BugBot re-review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 16, 2026

You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread brain-bar/Sources/BrainBar/Dashboard/StatusPopoverView.swift Outdated
Comment thread brain-bar/Sources/BrainBar/BrainBarServer.swift Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 638671e523

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread brain-bar/Sources/BrainBar/InjectionStore.swift
Comment thread brain-bar/Sources/BrainBar/InjectionStore.swift
Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 16, 2026

Follow-up fixes pushed in a85a001f for the open InjectionStore review threads.

@codex review
@cursor @BugBot re-review

Comment thread brain-bar/Sources/BrainBar/InjectionStore.swift
Comment thread brain-bar/Sources/BrainBar/Dashboard/PipelineState.swift Outdated
Comment thread brain-bar/Sources/BrainBar/BrainDatabase.swift
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@EtanHey
Copy link
Copy Markdown
Owner Author

EtanHey commented Apr 17, 2026

Follow-up fixes pushed for the recovered review items on head 24521cc. @codex review @cursor @BugBot re-review @coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

@EtanHey, I'll kick off a review of the follow-up fixes at head 24521cc6 now!


🧠 Learnings used
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-14T02:20:54.656Z
Learning: Request codex review, cursor review, and bugbot review for BrainLayer PRs

Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-14T02:20:54.656Z
Learning: Treat retrieval correctness, write safety, and MCP stability as critical-path concerns in BrainLayer reviews
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.


private func readMCPMessage(fd: Int32, timeout: TimeInterval = 5.0) throws -> [String: Any] {
var buffer = Data()
var buffer = bufferedMessagesByFD[fd] ?? Data()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium BrainBarTests/SocketIntegrationTests.swift:703

In readMCPMessage, when EOF or a non-recoverable read error occurs, the code removes fd from bufferedMessagesByFD (lines 719-720, 721-723) but then unconditionally re-stores bufferedMessagesByFD[fd] = buffer at line 728 before throwing. This preserves stale buffer data for a closed connection. Since the OS can reuse file descriptor numbers after close(), a subsequent connectClient() call may receive the same fd and inherit the stale buffered data from the previous connection, causing incorrect parsing or test failures. Consider skipping the re-store when the connection is dead (after the break statements at lines 720 or 723).

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file brain-bar/Tests/BrainBarTests/SocketIntegrationTests.swift around line 703:

In `readMCPMessage`, when EOF or a non-recoverable read error occurs, the code removes `fd` from `bufferedMessagesByFD` (lines 719-720, 721-723) but then unconditionally re-stores `bufferedMessagesByFD[fd] = buffer` at line 728 before throwing. This preserves stale buffer data for a closed connection. Since the OS can reuse file descriptor numbers after `close()`, a subsequent `connectClient()` call may receive the same `fd` and inherit the stale buffered data from the previous connection, causing incorrect parsing or test failures. Consider skipping the re-store when the connection is dead (after the `break` statements at lines 720 or 723).

Evidence trail:
brain-bar/Tests/BrainBarTests/SocketIntegrationTests.swift lines 703-729 at REVIEWED_COMMIT: readMCPMessage function shows the removal at lines 719-720 (EOF case) and 721-723 (error case) followed by unconditional re-store at line 728.

Comment thread brain-bar/Sources/BrainBar/BrainBarServer.swift
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24521cc63f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +102 to 107
let currentDataVersion = try database.dataVersion()
if force || currentDataVersion != lastDataVersion {
events = try database.listInjectionEvents(
sessionID: currentSessionID,
limit: currentLimit
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move injection refresh DB reads off the main actor

InjectionStore is @MainActor, and refresh(force:) performs synchronous SQLite calls (dataVersion and listInjectionEvents) directly on that actor. Because this code path is triggered by both the 250ms poll loop and Darwin notifications, any DB lock contention can block the UI thread (the database connection is configured with a long busy timeout), which can freeze the popover/menubar app during enrichment lock windows. This regression was introduced by replacing GRDB observation with direct reads on the main actor.

Useful? React with 👍 / 👎.

Comment on lines +377 to +380
private func flushPendingWrites(fd: Int32) -> Bool {
guard var state = clients[fd] else { return false }
state.hasScheduledWriteRetry = false
clients[fd] = state
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep retry guard set while a stalled write is still pending

flushPendingWrites clears hasScheduledWriteRetry before attempting to write, even when the socket is still backpressured. If more responses are enqueued before the previously scheduled retry fires, each enqueue path resets the flag and schedules another asyncAfter, producing a growing queue of redundant retry tasks for the same fd. Under sustained backpressure this adds avoidable queue churn and can degrade responsiveness for other clients.

Useful? React with 👍 / 👎.

@EtanHey EtanHey merged commit ec0c12b into main Apr 17, 2026
6 of 7 checks passed
@EtanHey EtanHey deleted the feat/brainbar-ux-overhaul branch April 17, 2026 08:16
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 99a0d6d. Configure here.


func openConversation(chunkID: String) {
selectedConversation = try? database.expandedConversation(id: chunkID)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silent error swallowing hides conversation load failures

Medium Severity

KGViewModel.openConversation uses try? to silently discard database errors, so when a user clicks "Open" on a linked chunk in the knowledge-graph sidebar and the query fails (chunk not found, database locked, etc.), nothing happens — no sheet, no error message. The parallel code path in InjectionFeedView properly catches errors and shows an alert via conversationErrorMessage. This inconsistency means KG users get zero feedback on failure.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 99a0d6d. Configure here.

track: activityTracks.enriching,
detailRateText: DashboardMetricFormatter.rateDetailString(
ratePerMinute: enrichmentDisplayRatePerMinute
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Render recomputes rates already derived by PipelineActivityTracks

Low Severity

render() manually computes enrichmentDisplayRatePerMinute and indexingRatePerMinute using PipelineActivityTracks.displayedRatePerMinute and recentRatePerMinute, then a few lines later calls PipelineActivityTracks.derive() which internally recomputes exactly the same rates with the same inputs and defaults. These duplicated calculations diverge silently if the default parameters ever change in one place but not the other. Exposing the rates from PipelineActivityTrack or PipelineActivityTracks would remove the duplication.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 99a0d6d. Configure here.

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