Skip to content

Conversation

pitabash-eGov
Copy link
Contributor

@pitabash-eGov pitabash-eGov commented Aug 12, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue where the Inbox breadcrumb was missing on complaint detail pages. The breadcrumb now appears on both the Inbox and complaint details, offering consistent context and a quicker path back to the Inbox during case review. No other navigation behavior is affected. Improves overall navigation clarity for employees.

@pitabash-eGov pitabash-eGov self-assigned this Aug 12, 2025
@pitabash-eGov pitabash-eGov requested a review from a team as a code owner August 12, 2025 09:25
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

📝 Walkthrough

Walkthrough

Expanded the breadcrumb display condition in the PGR employee UI to show the "Inbox" breadcrumb on both "inbox" and "complaint-details" routes within the employee page component.

Changes

Cohort / File(s) Summary
PGR Employee UI Breadcrumb Logic
health/.../pgr/src/pages/employee/index.js
Broadened breadcrumb visibility condition to include paths containing "complaint-details" in addition to "inbox".

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Router
  participant EmployeePage
  participant Breadcrumbs

  User->>Router: Navigate to route
  Router->>EmployeePage: Render with current path
  EmployeePage->>Breadcrumbs: Determine visibility (path includes "inbox" or "complaint-details")
  alt Matches condition
    Breadcrumbs-->>User: Show "Inbox" breadcrumb
  else
    Breadcrumbs-->>User: Hide "Inbox" breadcrumb
  end
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I hopped through routes with gentle feet,
A breadcrumb trail now twice as sweet—
Inbox shines where complaints unfold,
A tidy path for stories told.
With whiskers twitching, bugs take flight,
I nibble code—everything feels right. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch complaint_breadcum_issue

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 417b72e and 751ba14.

📒 Files selected for processing (1)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/index.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit Configuration File

check

Files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/index.js
🧠 Learnings (1)
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
PR: egovernments/DIGIT-Frontend#1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/index.js
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/index.js (1)

55-58: Inbox breadcrumb now correctly appears on complaint-details

Expanding the condition to include complaint-details ensures the trail becomes Home > Inbox > Complaint Details, which matches expected UX. This aligns with the PR objective.

Comment on lines 55 to 58
internalLink: `/${window?.contextPath}/employee/pgr/inbox-v2`,
content: t("PGR_INBOX"),
show: location.pathname.includes("inbox"),
show: location.pathname.includes("inbox") || location.pathname.includes("complaint-details"),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Prefer route-aware matching (matchPath) over substring includes

Using includes on pathname can produce false positives and is brittle if routes evolve (e.g., inbox-v3 or localized paths). Suggest matching against the configured route patterns using react-router’s matchPath and the existing base path prop for consistency.

Apply this diff within the current segment to delegate to a named boolean:

-                show: location.pathname.includes("inbox") || location.pathname.includes("complaint-details"),
+                show: showInboxCrumb,

Add the following supporting changes elsewhere in this file:

  • Import:
import { matchPath } from "react-router-dom";
  • Compute the booleans (place after useLocation and before the return):
const showInboxCrumb = Boolean(
  matchPath(location.pathname, { path: `${path}/inbox-v2`, exact: false }) ||
  matchPath(location.pathname, { path: `${path}/complaint-details/:id`, exact: false })
);

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