Skip to content

[FIX] Logs page bugs - #440

Merged
Fermionic-Lyu merged 1 commit into
mainfrom
fix-logs-page
Oct 16, 2025
Merged

Fermionic-Lyu merged 1 commit into
mainfrom
fix-logs-page

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented Oct 16, 2025 •

Copy link
Copy Markdown
Member

Summary

  1. Switching sources won't reset current page number

  2. Fix wording for empty list

How did you test this change?

Tested locally.

Summary by CodeRabbit

  • Bug Fixes

    • Logs table now displays a more accurate empty state: shows “No logs match your search criteria” when a search or narrowed severity filter is applied; otherwise shows “No logs found.”
    • Pagination resets when changing the log source, preventing stale or empty pages after switching sources.
  • New Features

    • Improved logs browsing experience with clearer feedback for filtered searches and automatic page reset on source changes.

1. Switching sources won't reset current page number

2. Fix wording for empty list
@coderabbitai

coderabbitai Bot commented Oct 16, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Updates in the logs feature adjust when the empty state message is shown in the table and expand the pagination-reset effect to also react to source changes. No public APIs changed.

Changes

Cohort / File(s) Summary of Changes
Logs filtering and pagination behavior
frontend/src/features/logs/components/LogsContent.tsx, frontend/src/features/logs/hooks/useLogs.ts
Logs table emptyMessage now depends on active search query or reduced severity filter instead of filtered results; pagination reset effect now also triggers on source changes (dependency array updated and comment adjusted).

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant UI as LogsContent.tsx
  participant Hook as useLogs()
  participant Table as LogsTable

  User->>UI: Change search/severity/source
  UI->>Hook: Update params (searchQuery, severityFilter, source)
  Hook->>Hook: Effect: if any param changes, reset page to 1
  Hook-->>UI: New state (page, filters)
  UI->>Table: Render with emptyMessage based on (searchQuery || severityFilter.length < 3)
  alt No results
    Table-->>User: "No logs match your search criteria" or "No logs found"
  else Results present
    Table-->>User: Display logs
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nose through logs with twitchy delight,
Filters flick, pages reset just right.
If searches narrow, no carrots to see—
The table whispers, “No matches from me.”
But when source shifts, I hop back to one,
Ears up, paws ready—the debugging’s begun! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “[FIX] Logs page bugs” clearly indicates that the pull request addresses bugs on the logs page without including irrelevant details or vague terminology, succinctly capturing the primary intent of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-logs-page

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7e97c1 and 8967fe7.

📒 Files selected for processing (2)
  • frontend/src/features/logs/components/LogsContent.tsx (1 hunks)
  • frontend/src/features/logs/hooks/useLogs.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
  • frontend/src/features/logs/hooks/useLogs.ts
frontend/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{tsx,ts}: Use functional React components with hooks exclusively
Use Radix UI primitives for accessibility
Optimize React component re-renders

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
  • frontend/src/features/logs/hooks/useLogs.ts
frontend/src/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.tsx: Implement TypeScript interfaces/types for all component props
Follow component composition patterns; keep components focused and single-purpose
Implement proper loading and error states in UI
Use a consistent icon set from lucide-react

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{ts,tsx}: Use TanStack Query for server state management
Use React Hook Form for form handling with Zod validation
Optimize bundle size with proper imports

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
  • frontend/src/features/logs/hooks/useLogs.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
  • frontend/src/features/logs/hooks/useLogs.ts
frontend/src/**/[A-Z]*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Component files must use PascalCase filenames (e.g., DataGrid.tsx)

Files:

  • frontend/src/features/logs/components/LogsContent.tsx
frontend/src/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Hook files must be named usePascalCase.ts (e.g., useAuth.ts)

Files:

  • frontend/src/features/logs/hooks/useLogs.ts
**/[a-z][a-z0-9-]*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Utility files should use kebab-case or camelCase (kebab-case validated here)

Files:

  • frontend/src/features/logs/hooks/useLogs.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: E2E Tests
🔇 Additional comments (2)
frontend/src/features/logs/hooks/useLogs.ts (1)

50-53: LGTM! Page reset now handles source changes correctly.

The addition of source to the dependency array correctly ensures that switching sources resets the page number to 1, addressing the bug described in the PR objectives. The updated comment accurately reflects the expanded scope of this effect.

frontend/src/features/logs/components/LogsContent.tsx (1)

257-259: LGTM! Improved empty state messaging.

The updated logic correctly distinguishes between a filtered/searched empty state ("No logs match your search criteria") and a truly empty state ("No logs found"). The condition appropriately checks both logsSearchQuery and whether severity filters have been modified (severityFilter.length < 3), providing clearer user feedback.


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

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