Skip to content

feat: add sidebar filters to logs page#2731

Merged
akshaydeo merged 1 commit intov1.5.0from
04-15-improvement_logs_page_filter_ui_revamp
Apr 16, 2026
Merged

feat: add sidebar filters to logs page#2731
akshaydeo merged 1 commit intov1.5.0from
04-15-improvement_logs_page_filter_ui_revamp

Conversation

@impoiler
Copy link
Copy Markdown
Contributor

@impoiler impoiler commented Apr 15, 2026

Summary

Adds a collapsible sidebar to the logs page containing all filter options, replacing the previous popover-based filter interface. This provides better organization and easier access to filtering capabilities.

Changes

  • Added new LogsSidebar component with collapsible filter sections for status, models, providers, types, aliases, routing engines, routing rules, sessions, cost, and metadata
  • Modified logs page layout to use a two-column design with sidebar and main content area
  • Updated LogFilters component to conditionally hide popover filters when sidebar is active
  • Fixed missing_cost_only filter initialization to default to false instead of preserving previous state
  • Adjusted styling and layout classes for the new sidebar design
  • Added loading states and skeleton components for filter sections
  • Implemented smart section expansion (first two sections open by default, others open when they have active filters)

Type of change

  • Feature
  • Bug fix
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Navigate to the logs page and verify:

  1. Sidebar appears on the left with collapsible filter sections
  2. Filter selections work correctly and update the logs table
  3. Active filters cause their sections to expand automatically
  4. Reset button clears all filters except date range
  5. Loading states display properly when fetching filter data
  6. Layout is responsive and content doesn't overflow
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Add screenshots showing the new sidebar layout and filter interface

Breaking changes

  • Yes
  • No

Related issues

Link any related issues or feature requests

Security considerations

No security implications - this is a UI enhancement that doesn't affect authentication, data handling, or API endpoints.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@impoiler has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28ae163a-4e7c-4e9b-951a-e230fc527291

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd7ef5 and dd37c8b.

📒 Files selected for processing (8)
  • ui/app/workspace/logs/page.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/logs/views/emptyState.tsx
  • ui/app/workspace/logs/views/filters.tsx
  • ui/app/workspace/logs/views/logsSidebar.tsx
  • ui/app/workspace/logs/views/logsTable.tsx
  • ui/app/workspace/logs/views/logsVolumeChart.tsx
  • ui/components/table/columnConfigDropdown.tsx
📝 Walkthrough

Walkthrough

This pull request introduces a sidebar filtering UI for the logs page. A new LogsSidebar component provides collapsible filter sections including lazy-loaded options, custom metadata filters, and reset functionality. The main logs page layout is restructured to accommodate the sidebar alongside the data table, with filter controls conditionally hidden from the header when sidebar filtering is active.

Changes

Cohort / File(s) Summary
Logs Page Layout & Sidebar Integration
ui/app/workspace/logs/page.tsx, ui/app/workspace/logs/views/logsSidebar.tsx, ui/app/workspace/logs/views/logsTable.tsx, ui/app/workspace/logs/views/filters.tsx
New LogsSidebar component provides collapsible filter sections (providers, models, aliases, status, type, session, cost, metadata) with lazy loading via RTK query hooks. Main page restructured with full-width background container and sidebar integration. Filter controls conditionally hidden from header when sidebarFilters prop is enabled. LogFilters now accepts hidePopoverFilters to suppress date/popover controls. Filter update logic no longer defaults missing_cost_only from previous state.
View & Style Adjustments
ui/app/workspace/logs/views/emptyState.tsx, ui/app/workspace/logs/views/logsVolumeChart.tsx, ui/app/workspace/logs/sheets/logDetailView.tsx, ui/components/table/columnConfigDropdown.tsx
Added p-4 padding to empty state wrapper. Adjusted logs volume chart skeleton styling (height 131px128px, marginTop 48). Minor import reordering in logDetailView. Added explicit width (w-7.5) to column config dropdown button.

Sequence Diagram

sequenceDiagram
    actor User
    participant LogsSidebar
    participant LogsPage
    participant LogsDataTable
    participant API

    User->>LogsSidebar: Toggle filter section / Select filter option
    LogsSidebar->>LogsSidebar: Compute filter changes
    LogsSidebar->>LogsPage: onFiltersChange(updatedFilters)
    LogsPage->>LogsPage: setFilters(updatedFilters)
    LogsPage->>LogsDataTable: Pass updated filters
    LogsDataTable->>API: Fetch logs with filters
    API-->>LogsDataTable: Return filtered results
    LogsDataTable->>User: Render updated table
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Hark! A sidebar blooms with filter delight,
Collapsible sections, lazy-loaded might,
Metadata dances with checkbox grace,
While logs now sparkle in their rightful place!
Filters cascade like carrots in spring,
Reset buttons and all—what joy they bring! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main feature addition: a sidebar filter interface for the logs page, which aligns with the primary changeset.
Description check ✅ Passed The description covers all key sections: summary, changes, type of change, affected areas, testing steps, breaking changes, and a completed checklist; however, screenshots/recordings placeholder lacks actual content.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 04-15-improvement_logs_page_filter_ui_revamp

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

@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch 8 times, most recently from bfa3a9b to 41f44b7 Compare April 15, 2026 17:55
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch 2 times, most recently from ca20027 to 5efc13f Compare April 16, 2026 03:14
@impoiler impoiler self-assigned this Apr 16, 2026
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch from 5efc13f to 0c0c1d1 Compare April 16, 2026 05:49
@impoiler impoiler changed the title improvement: logs page filter UI revamp feat: add sidebar filters to logs page Apr 16, 2026
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch from 0c0c1d1 to 8dd7ef5 Compare April 16, 2026 08:16
@impoiler impoiler marked this pull request as ready for review April 16, 2026 10:06
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Confidence Score: 3/5

Not safe to merge until the date-range picker regression and stale metadata customInputs issues from prior threads are resolved.

Two confirmed P1 defects from previous review threads remain in the codebase: (1) users in sidebar mode have no UI path to set a custom time range since DateTimePicker is hidden and the sidebar doesn't provide one, and (2) stale customInputs state in MetadataFilters can silently re-apply a cleared filter after Reset. New findings in this pass are P2 only (chart skeleton chevron state, FilterSection forced-open not propagating to parent opened).

ui/app/workspace/logs/views/logsSidebar.tsx (date-range gap, stale customInputs) and ui/app/workspace/logs/views/filters.tsx (DateTimePicker gating).

Important Files Changed

Filename Overview
ui/app/workspace/logs/views/logsSidebar.tsx New sidebar with 12 filter sub-components; carries several P1 issues flagged in prior review threads (date range inaccessible, stale customInputs on reset, mount-time auto-focus) that remain unresolved in this version.
ui/app/workspace/logs/page.tsx Page restructured to two-column layout with LogsSidebar + main content; always passes sidebarFilters to LogsDataTable, which hides DateTimePicker — the prior P1 date-range inaccessibility applies here.
ui/app/workspace/logs/views/filters.tsx Added hidePopoverFilters prop; DateTimePicker and FilterPopover are gated behind !hidePopoverFilters, which is always true in the new layout — no new bugs introduced beyond the existing date-range gap.
ui/app/workspace/logs/views/logsTable.tsx Added sidebarFilters prop to conditionally render the filter bar without the popover controls; straightforward and correct.
ui/app/workspace/logs/views/logsVolumeChart.tsx Wrapped chart in a Collapsible with external open/close state; loading skeleton hard-codes the chevron direction, causing a brief visual flash when the chart is collapsed and data refetches.

Reviews (5): Last reviewed commit: "improvement: logs page filter UI revamp" | Re-trigger Greptile

Comment thread ui/app/workspace/logs/views/filters.tsx
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/app/workspace/logs/views/logsSidebar.tsx`:
- Around line 188-193: The current useAutoFocusOnOpen hook focuses whenever
isOpen is true (including initial mount), causing default-open sections like
ModelsFilter to steal focus; change useAutoFocusOnOpen to only call
ref.current?.focus() when isOpen transitioned from false to true (i.e., check
previous isOpen state using a useRef prevIsOpen or a didMount flag) so initial
true does not trigger focus, and reference/use this updated hook in the
ModelsFilter search input.
- Around line 44-76: The new sidebar misses stable data-testid attributes on
interactive controls; update the Reset Button (the Button with RotateCcw), the
collapsible triggers and their toggle buttons inside components like
StatusFilter, ModelsFilter, SelectedKeysFilter, VirtualKeysFilter,
ProvidersFilter, TypeFilter, AliasesFilter, RoutingEnginesFilter,
RoutingRulesFilter, SessionFilter, CostFilter and MetadataFilters, and any
checkboxes/inputs within those components to include data-testid following the
convention data-testid="<entity>-<element>-<qualifier>" (e.g.
"filters-reset-button", "status-filter-toggle", "models-filter-checkbox-<name>",
"selected-keys-input"); ensure each interactive element has a unique, stable
test id and apply the same pattern to the other referenced new controls in this
file so E2E selectors can rely on them.
- Around line 578-605: The MetadataFilters component currently returns null when
the query is skipped (via useGetAvailableFilterDataQuery skip) and entries are
empty, causing the entire Metadata section to disappear; update MetadataFilters
so it always renders the top-level section/header (respecting opened/defaultOpen
and the collapse UI) even when the query is skipped and entries are empty, and
only skip rendering the inputs/list; specifically, keep the existing
useGetAvailableFilterDataQuery(skip: !opened && !hasActive) logic but
remove/replace the early return (the check using
isUninitialized/isLoading/entries.length && !hasActive) with rendering a
collapsed/placeholder section UI that can toggle opened, then render the entries
list only when entries.length > 0 and/or when the query has returned data;
reference the MetadataFilters component, the opened/hasActive flags, entries,
and useGetAvailableFilterDataQuery.

In `@ui/app/workspace/logs/views/logsTable.tsx`:
- Around line 171-194: The current conditional passes hidePopoverFilters to
LogFiltersComponent when sidebarFilters is true, which causes
DateTimePickerWithRange and FilterPopover to be hidden (via
DateTimePickerWithRange / FilterPopover in filters.tsx) while the new
logsSidebar.tsx doesn't provide a replacement; remove or change that behavior so
the date-range picker remains available until the sidebar implements one: in the
sidebarFilters branch of the JSX (where LogFiltersComponent is rendered with
hidePopoverFilters) stop passing hidePopoverFilters (or explicitly pass a prop
to show the date picker, e.g., showDateRange=true), so DateTimePickerWithRange
and FilterPopover continue to render when needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48b4b27b-0d62-47c2-94ca-c9a8ffb8b20e

📥 Commits

Reviewing files that changed from the base of the PR and between d56fa10 and 8dd7ef5.

📒 Files selected for processing (8)
  • ui/app/workspace/logs/page.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/logs/views/emptyState.tsx
  • ui/app/workspace/logs/views/filters.tsx
  • ui/app/workspace/logs/views/logsSidebar.tsx
  • ui/app/workspace/logs/views/logsTable.tsx
  • ui/app/workspace/logs/views/logsVolumeChart.tsx
  • ui/components/table/columnConfigDropdown.tsx

Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx Outdated
Comment thread ui/app/workspace/logs/views/logsTable.tsx
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch 2 times, most recently from 0c443fd to ccad6cd Compare April 16, 2026 13:38
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch from ccad6cd to c7af46d Compare April 16, 2026 13:58
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 16, 2026
@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch from c7af46d to faf3906 Compare April 16, 2026 13:59
Comment thread ui/app/workspace/logs/views/logsSidebar.tsx
Comment thread ui/app/workspace/logs/views/filters.tsx
Copy link
Copy Markdown
Contributor

akshaydeo commented Apr 16, 2026

Merge activity

  • Apr 16, 2:34 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 2:35 PM UTC: Graphite couldn't merge this PR because it had merge conflicts.
  • Apr 16, 3:16 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 3:16 PM UTC: @akshaydeo merged this pull request with Graphite.

@impoiler impoiler force-pushed the 04-15-improvement_logs_page_filter_ui_revamp branch from faf3906 to dd37c8b Compare April 16, 2026 14:59
@akshaydeo akshaydeo merged commit 29df156 into v1.5.0 Apr 16, 2026
9 of 19 checks passed
@akshaydeo akshaydeo deleted the 04-15-improvement_logs_page_filter_ui_revamp branch April 16, 2026 15:16
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.

2 participants