Skip to content

Distinguish empty-state messages in PullRequestsTab (no repos vs no PRs vs no filter matches) #81

Description

@Jagadeeshftw

📌 Description

src/features/maintainers/components/pull-requests/PullRequestsTab.tsx renders a single generic empty message that conflates three distinct conditions: no repositories selected, repositories selected but containing no PRs, and active filters returning no matches. Users cannot tell why the list is empty or how to recover.

💡 Why it matters: A precise empty state tells the user the next action (select a repo, clear filters), reducing confusion.

🧩 Requirements and context

  • Detect and branch the three states explicitly.
  • "No repos selected" prompts repository selection.
  • "No PRs" reflects an empty result for selected repos.
  • "No matches" appears when filters exclude all rows and offers a Clear Filters action.
  • Ensure the empty state is announced (role="status").

Non-functional requirements

  • Must be secure, tested, and documented.
  • Should be efficient and easy to review.

🛠️ Suggested execution

1. Fork the repo and create a branch

git checkout -b feat/pr-tab-empty-states

2. Implement changes

  • Write/modify the relevant source: src/features/maintainers/components/pull-requests/PullRequestsTab.tsx
  • Write comprehensive tests: src/features/maintainers/components/pull-requests/PullRequestsTab.test.tsx
  • Add documentation: inline TSDoc on the empty-state logic
  • Include TSDoc comments
  • Validate security assumptions: n/a

3. Test and commit

  • Run tests:
npm run test
  • Cover edge cases: each of the three conditions, plus transition from filtered-empty back to results
  • Include test output and security notes in the PR description.

Example commit message

feat(maintainers): differentiate PR list empty states

✅ Acceptance criteria

  • Three distinct empty-state messages render correctly
  • "No matches" offers Clear Filters
  • Empty state announced via role="status"
  • Tests cover all three conditions

🔒 Security notes

None; presentation only.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions