Skip to content

Fix: use unfiltered total count for EmptyState; stable scroll handler…#527

Merged
ritik4ever merged 5 commits into
ritik4ever:mainfrom
boalambo:feature/empty-state-count-fix
Jun 1, 2026
Merged

Fix: use unfiltered total count for EmptyState; stable scroll handler…#527
ritik4ever merged 5 commits into
ritik4ever:mainfrom
boalambo:feature/empty-state-count-fix

Conversation

@boalambo
Copy link
Copy Markdown

@boalambo boalambo commented May 29, 2026

Closes #398


…; tests

What changed

Testing done

Related issues

Closes #

Checklist

  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.

Summary by CodeRabbit

  • New Features

    • Light/dark theme toggle and create-stream scroll behavior
    • Empty-state UI with contextual filter clearing and create-stream action
    • Pause, resume, and start-time update actions for streams
    • 7-day metrics history tracking and updated dashboard metric computation
    • Streams table now surfaces total counts and supports create-stream callbacks
  • Bug Fixes

    • Dashboard and stream flows refresh overall unfiltered counts after mutations
  • Tests

    • Added tests for backlog empty and populated states
  • Refactor

    • Simplified backlog display and reduced UI complexity
  • Chores

    • CI-aware build plugin and test exclusion tweaks

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

Someone is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This PR adds an EmptyState component to display contextual messages when stream filters return no results, extends App.tsx with theme state management and unfiltered stream count tracking, introduces new stream control handlers (pause, resume, updateStartTime), simplifies IssueBacklog rendering, and updates build/test configuration.

Changes

Streams UI, Controls, and Metrics

Layer / File(s) Summary
EmptyState component contract and rendering
frontend/src/components/EmptyState.tsx
New EmptyStateProps interface and EmptyState component derive contextual headlines from active filters (status, sender, recipient, asset, search), compute hasActiveFilters to detect non-empty filter values, and conditionally show "Clear Filters" (when filters active) and "Create Stream" (when no streams exist) buttons.
App state, theme, and metrics wiring
frontend/src/App.tsx
Adds showToast, viewMode, and detailStreamId state; introduces theme state (light/dark) with toggle and document dataset effect; tracks totalUnfilteredCount separately; fetches useMetricsHistory("7d"); memoizes dashboard metrics and table/API filter objects; provides scrollToCreateStream helper and bootstraps unfiltered count on mount.
App stream mutation handlers with count refresh
frontend/src/App.tsx
WebSocket lifecycle handling now refreshes both filtered streams and totalUnfilteredCount; handleCreate and handleCancel refresh the unfiltered count on success; new handlePause, handleResume, and handleUpdateStartTime handlers call corresponding APIs, refresh streams and totalUnfilteredCount, and show success/error toasts.
App UI integration and CreateStreamForm wiring
frontend/src/App.tsx
Theme toggle button markup updated; CreateStreamForm wrapped in CREATE_STREAM_SECTION_ID container for scroll-to behavior; StreamsTable receives totalStreamCount and onCreateStream callback to support EmptyState and scrolling; App remains exported as default.
StreamsTable props, CSV export, and timeline toggle refactoring
frontend/src/components/StreamsTable.tsx
StreamsTableProps adds optional totalStreamCount and onCreateStream fields; CSV export URL memoization casts filters to Record<string, string> for getExportCsvUrl; onOpenStream invocation centralized inside toggleTimeline callback (no longer direct button onClick); timeline toggle button sets aria-expanded/aria-controls attributes.

IssueBacklog Simplification

Layer / File(s) Summary
IssueBacklog component simplification
frontend/src/components/IssueBacklog.tsx
IssueBacklogProps now allows issues to be optional with default []; component signature adds loading = false default; loading state replaces placeholder structure with simple "Loading..." message; empty-state returns "No backlog issues." when issues.length === 0; issue list rendering pares down to show only title, summary, and complexity/points; removes prior SortKey types, ordering constants, and visibleIssues references.
IssueBacklog test coverage
frontend/src/components/IssueBacklog.test.tsx
Adds Vitest test file with two test cases: empty-state verification (empty issues array asserts "No backlog issues." text) and non-empty list verification (asserts provided issue title appears in DOM).

Build and Configuration Updates

Layer / File(s) Summary
TypeScript, Vite PWA, and MSW mock configuration
frontend/tsconfig.json, frontend/vite.config.ts, frontend/src/handlers.ts
frontend/tsconfig.json adds exclude directive to omit test files and __tests__ directories from TypeScript compilation; frontend/vite.config.ts wraps VitePWA plugin in conditional spread to disable PWA plugin when process.env.CI === 'true' while preserving workbox runtime caching and manifest configuration; frontend/src/handlers.ts adds new http.get('/api/config') MSW mock handler returning allowedAssets list (USDC, XLM).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App
  participant CreateStreamForm
  participant StreamsTable
  participant EmptyState
  participant API
  
  User->>App: Apply filter (status/sender/etc)
  App->>StreamsTable: Pass filtered results + totalStreamCount
  StreamsTable->>StreamsTable: Filter list empty && totalStreamCount > 0?
  StreamsTable->>EmptyState: Render with active filter context
  EmptyState->>User: Show "No streams for [filter]" + "Clear Filters"
  User->>EmptyState: Click "Clear Filters"
  EmptyState->>App: onClearFilters()
  App->>API: Fetch streams (no filter)
  API-->>App: Full stream list
  App->>StreamsTable: Pass all results
  StreamsTable->>User: Display table or empty state
  
  User->>StreamsTable: Click timeline toggle
  StreamsTable->>App: toggleTimeline() → onOpenStream(id)
  App->>User: Open stream detail
  
  User->>CreateStreamForm: Submit new stream
  CreateStreamForm->>API: POST /streams
  API-->>App: Success
  App->>App: Refresh filtered streams + totalUnfilteredCount
  App->>App: scrollToCreateStream()
  App->>User: Scroll to form, show success toast
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through streams with glee,
Empty states now serve tea,
Theme-dark nights, metrics bright,
Pause and resume feel just right—
Creating flows, scrolling free! 🌙✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes to handlers.ts, tsconfig.json, vite.config.ts, IssueBacklog, and StreamsTable props are out-of-scope additions not required by #398's acceptance criteria. Verify whether MSW config, TypeScript exclude, VitePWA CI guard, and IssueBacklog changes serve a legitimate dependency. Consider moving unrelated changes to separate PRs or documenting their necessity.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references the main objectives (unfiltered total count for EmptyState, stable scroll handler) and aligns with the core scope of issue #398.
Linked Issues check ✅ Passed All acceptance criteria from #398 are met: EmptyState component renders when filtered list is empty, message adapts to active filters, Clear Filters button resets filters, Create Stream button shown when no streams exist, and Vitest test added.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@boalambo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/components/StreamsTable.tsx`:
- Around line 219-225: The inline timeline expansion state (expandedStreamId) is
never toggled because toggleTimeline is not wired to the row button/StreamRow;
currently the expand button calls onOpenStream directly so isExpanded remains
false and the expanded timeline never renders. Fix by wiring toggleTimeline into
the row open handler (pass toggleTimeline into StreamRow or have the expand
button call toggleTimeline(streamId) instead of onOpenStream(streamId)) so
setExpandedStreamId runs and isExpanded becomes true; note toggleTimeline
already invokes onOpenStream(streamId) so the drawer will still open—if you want
inline-only expansion, remove that onOpenStream call from toggleTimeline, or
conversely remove expandedStreamId/toggleTimeline and the isExpanded timeline
row if only the drawer UX is desired.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: a90352b4-3d74-460a-a01f-802d00b8f1b7

📥 Commits

Reviewing files that changed from the base of the PR and between 48f2cca and c433b8f.

📒 Files selected for processing (4)
  • frontend/src/App.tsx
  • frontend/src/components/EmptyState.tsx
  • frontend/src/components/StreamsTable.test.tsx
  • frontend/src/components/StreamsTable.tsx

Comment thread frontend/src/components/StreamsTable.tsx Outdated
@espcris05-commits
Copy link
Copy Markdown

👋 Friendly bump! This PR is ready for review. CodeRabbit and CI checks passed. Let me know if any adjustments are needed.

Payment: USDC Stellar GCR377MUJ75YKFLNZKT6XPWNDUIEDZDUHUWY5E2LHOBBSSJDU7MJRZXF

@boalambo
Copy link
Copy Markdown
Author

boalambo commented May 30, 2026

👋 Friendly bump! This PR is ready for review. CodeRabbit and CI checks passed. Let me know if any adjustments are needed.

Payment: USDC Stellar GCR377MUJ75YKFLNZKT6XPWNDUIEDZDUHUWY5E2LHOBBSSJDU7MJRZXF

Hi! I noticed contributors are including a payment address in their PR comments. Should I add the new payment address as well?

@ritik4ever ritik4ever merged commit c212e17 into ritik4ever:main Jun 1, 2026
4 of 6 checks passed
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.

Add EmptyState for zero-stream filter results

3 participants