Skip to content

feat(ui): add warning banner when repository has 0 commits in analyzed range (#208) - #495

Merged
eshaanag merged 1 commit into
eshaanag:mainfrom
Myparadox-creator:feat/empty-commits-warning-banner-208
Sep 1, 2026
Merged

feat(ui): add warning banner when repository has 0 commits in analyzed range (#208)#495
eshaanag merged 1 commit into
eshaanag:mainfrom
Myparadox-creator:feat/empty-commits-warning-banner-208

Conversation

@Myparadox-creator

@Myparadox-creator Myparadox-creator commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Closes

#208

Problem

If a repository exists but has 0 commits in the analyzed range (or when a date filter excludes all commits), the dashboard previously displayed empty or broken states without guidance advising the user on how to resolve the issue.

Solution

  1. EmptyCommitsWarningBanner Component:

    • Created frontend/src/components/EmptyCommitsWarningBanner.tsx with a glassmorphic amber banner, icons, clear titles, and context-aware messaging.
    • Dynamically detects whether 0 commits is due to an active time filter (7d, 30d, 1y, custom) vs 0 analyzed commits in the repository overall.
    • Provides quick-action buttons:
      • Reset to All Time: resets the time range filter when a filter is active.
      • Update Analysis: triggers a repository rescan.
      • Adjust Settings: navigates to the landing page to re-ingest with higher max commits or a different branch.
    • Built with accessibility in mind (role="alert" and data-testid="empty-commits-warning-banner").
  2. Dashboard Integration:

    • Integrated <EmptyCommitsWarningBanner /> in frontend/src/pages/DashboardPage.tsx when !timelineState.isLoading && commits.length === 0.
    • Wired callbacks for time filter resetting, rescan, and re-ingestion.
  3. Testing & Validation:

    • Added unit test suite in frontend/src/components/EmptyCommitsWarningBanner.test.tsx.
    • Expanded frontend/src/pages/DashboardPage.test.tsx to verify warning banner rendering and reset interaction.
    • 100% test pass rate (121 frontend tests across 35 files; 287 backend tests).

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

@Myparadox-creator is attempting to deploy a commit to the Eshaan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added frontend Frontend changes docs Documentation changes labels Sep 1, 2026
@Myparadox-creator Myparadox-creator changed the title feat/empty commits warning banner 208 feat(ui): add warning banner when repository has 0 commits in analyzed range (#208) Sep 1, 2026
@eshaanag eshaanag added ECSoC26 Required tag — marks PR as counted for ECSoC 2026 scoring ECSoC26-L1 Easy — 5 pts (auto-applied by Sentinel) good-pr Bonus XP: exceptional PR (+15 XP) good-ui Bonus XP: notable UI contribution (+25 XP) labels Sep 1, 2026
@eshaanag
eshaanag merged commit 5a9df4e into eshaanag:main Sep 1, 2026
21 of 25 checks passed
@ecsoc-sentinel ecsoc-sentinel Bot added ECSoC26-L3 Difficult — 15 pts (auto-applied by Sentinel) and removed ECSoC26-L1 Easy — 5 pts (auto-applied by Sentinel) labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation changes ECSoC26-L3 Difficult — 15 pts (auto-applied by Sentinel) ECSoC26 Required tag — marks PR as counted for ECSoC 2026 scoring frontend Frontend changes good-pr Bonus XP: exceptional PR (+15 XP) good-ui Bonus XP: notable UI contribution (+25 XP)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants