Skip to content

Status Pages breadcrumbs #2061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 17, 2025

Conversation

nbgslv
Copy link
Contributor

@nbgslv nbgslv commented Apr 14, 2025

Describe your changes

Added breadcrumbs to status pages

Screenshot 2025-04-14 212337

Screenshot 2025-04-14 212352

issue number

#2057

Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.

  • (Do not skip this or your PR will be closed) I deployed the application locally.
  • (Do not skip this or your PR will be closed) I have performed a self-review and testing of my code.
  • I have included the issue # in the PR.
  • I have added i18n support to visible strings (instead of <div>Add</div>, use):
const { t } = useTranslation();
<div>{t('add')}</div>
  • The issue I am working on is assigned to me.
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme. I have no hardcoded dimensions.
  • My PR is granular and targeted to one specific feature.
  • I took a screenshot or a video and attached to this PR if there is a UI change.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

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

Auto Pull Request Review from LlamaPReview

1. Overview

1.1 Core Changes

  • Primary purpose and scope: Implement breadcrumb navigation for status page creation/edit and details views
  • Key components modified:
    • Status page creation/configuration views
    • Status details page layout
    • Localization files
  • Cross-component impacts: Navigation system, translation infrastructure
  • Business value alignment: Improves user navigation experience (UX-102 key metric)

1.2 Technical Architecture

  • System design modifications: Added new navigation layer to status pages
  • Component interaction changes: Breadcrumbs component integration with routing
  • Integration points impact: Affects status page routing and localization
  • Dependency changes: New translation keys added

2. Critical Findings

2.1 Must Fix (P0🔴)

No critical issues requiring immediate blocking action

2.2 Should Fix (P1🟡)

Issue: Incomplete localization support

  • Analysis Confidence: High
  • Impact: Missing translations in non-English locales will break breadcrumb labels
  • Suggested Solution: Add identical keys to all locale files (fr.json, de.json, etc.)

Issue: Accessibility compliance gaps

  • Analysis Confidence: Medium
  • Impact: Fails WCAG 2.1 AA requirements for navigation landmarks
  • Suggested Solution:
<nav aria-label="Breadcrumb">
  <ol style={/* existing styles */}>
    {list.map((crumb, i) => (
      <li key={crumb.path}>
        {i < list.length - 1 ? (
          <a href={crumb.path}>{crumb.name}</a>
        ) : (
          <span aria-current="page">{crumb.name}</span>
        )}
      </li>
    ))}
  </ol>
</nav>

Issue: Unvalidated statusPage.url reference

  • Analysis Confidence: High
  • Impact: Broken links during loading states
  • Suggested Solution: Add null checks and memoization:
const crumbs = useMemo(() => {
  const base = [{ name: t("statusPages"), path: "/status" }];
  if (isCreate) return [...base, { name: t("create"), path: "/status/create" }];
  if (!statusPage?.url) return base;
  return [...base, 
    { name: t("details"), path: `/status/uptime/${statusPage.url}` },
    { name: t("configure"), path: "" }
  ];
}, [isCreate, statusPage, t]);

2.3 Consider (P2🟢)

Area: Route management

  • Analysis Confidence: High
  • Improvement Opportunity: Reduce hardcoded path maintenance via central route config

Area: Crumb generation logic

  • Analysis Confidence: Medium
  • Improvement Opportunity: Abstract duplicate logic into shared hook

2.4 Summary of Action Items

  1. Add missing translation keys to all locale files (P1 - 1 day)
  2. Implement accessibility markup in Breadcrumbs component (P1 - 2 days)
  3. Add statusPage validation and memoization (P1 - 1 day)
  4. Consider route configuration abstraction (P2 - future sprint)

3. Technical Analysis

3.1 Code Logic Analysis

📁 src/Pages/StatusPage/Create/index.jsx - Breadcrumb implementation

  • Submitted PR Code:
    const crumbs = [
      { name: t("statusPages"), path: "/status" },
    ];
    if (isCreate) {
      crumbs.push({ name: t("create"), path: "/status/create" });
    } else {
      crumbs.push(
        { name: t("details"), path: `/status/uptime/${statusPage?.url}` },
        { name: t("configure"), path: "" }
      );
    }
  • Analysis:
    • Potential null reference if statusPage loads slowly
    • Missing memoization causes unnecessary re-renders
    • Hardcoded paths create maintenance risk
  • LlamaPReview Suggested Improvements:
    const crumbs = useMemo(() => {
      const base = [{ name: t("statusPages"), path: ROUTES.STATUS_HOME }];
      if (isCreate) return [...base, { name: t("create"), path: ROUTES.STATUS_CREATE }];
      if (!statusPage?.url) return base;
      return [
        ...base,
        { name: t("details"), path: ROUTES.STATUS_DETAILS(statusPage.url) },
        { name: t("configure"), path: "" }
      ];
    }, [isCreate, statusPage?.url, t]);
  • Improvement rationale:
    • Prevents invalid paths during loading states
    • Reduces render cycles through memoization
    • Centralizes route management

3.2 Key Quality Aspects

  • Testing strategy: Recommend adding Cypress tests for breadcrumb navigation paths
  • Documentation needs: Update component library docs with Breadcrumbs usage guidelines

4. Overall Evaluation

  • Technical assessment: Solid implementation with minor robustness improvements needed
  • Business impact: Directly improves user navigation experience (Key OKR: NUX-4)
  • Risk evaluation: Low technical risk with suggested fixes
  • Notable positive aspects:
    • Clean component integration
    • Proper translation implementation
    • Responsive layout preservation
  • Implementation quality: 8/10 - Lacks memoization but follows React best practices
  • Final recommendation: Request Changes (Address P1 items before merging)

💡 LlamaPReview Community
Have feedback on this AI Code review tool? Join our GitHub Discussions to share your thoughts and help shape the future of LlamaPReview.

Copy link

coderabbitai bot commented Apr 14, 2025

Walkthrough

This pull request introduces breadcrumb navigation to the CreateStatusPage and PublicStatus components. Both components now import and render the Breadcrumbs component, passing dynamically constructed breadcrumb arrays based on the local state values isCreate and isPublic. The breadcrumbs reflect the current page context, such as "Status Pages," "Create," "Details," and "Configure." Additionally, new localization keys supporting these breadcrumb labels have been added to the language file. The changes focus solely on UI enhancements without altering core logic or error handling.

Changes

Files Change Summary
src/Pages/StatusPage/…/Create/index.jsx and src/Pages/StatusPage/…/Status/index.jsx Imported and integrated the Breadcrumbs component. Constructed breadcrumb arrays conditionally based on isCreate or isPublic state. Rendered breadcrumbs accordingly. Removed alignItems="center" from the Stack in PublicStatus.
src/locales/gb.json Added localization keys: "statusBreadCrumbsDetails": "Details", "statusBreadCrumbsCreate": "Create", and "statusBreadCrumbsStatusPages": "Status Pages" to support breadcrumb labels.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CreateStatusPage
  participant Breadcrumbs
  User->>CreateStatusPage: Load Create Status Page
  CreateStatusPage-->>CreateStatusPage: Evaluate isCreate state
  alt isCreate = true
    CreateStatusPage-->>CreateStatusPage: Build crumbs for creation
  else isCreate = false
    CreateStatusPage-->>CreateStatusPage: Build crumbs for details/configuration
  end
  CreateStatusPage->>Breadcrumbs: Render Breadcrumbs(crumbs)
  Breadcrumbs-->>User: Display breadcrumb navigation
Loading
sequenceDiagram
  participant User
  participant PublicStatus
  participant Breadcrumbs
  User->>PublicStatus: Load Public Status Page
  alt isPublic = false
    PublicStatus-->>PublicStatus: Create crumbs with "Status Pages" and "Details"
    PublicStatus->>Breadcrumbs: Render Breadcrumbs(crumbs)
    Breadcrumbs-->>User: Display breadcrumb navigation
  else isPublic = true
    PublicStatus-->>PublicStatus: Do not render Breadcrumbs
  end
Loading

Possibly related PRs

Suggested reviewers

  • ajhollid
  • danielcj2
  • gorkem-bwl

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ede028 and 6383d60.

📒 Files selected for processing (3)
  • src/Pages/StatusPage/Create/index.jsx (3 hunks)
  • src/Pages/StatusPage/Status/index.jsx (3 hunks)
  • src/locales/gb.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/locales/gb.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Pages/StatusPage/Status/index.jsx
  • src/Pages/StatusPage/Create/index.jsx

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

  • 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

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

🧹 Nitpick comments (1)
src/Pages/StatusPage/Create/index.jsx (1)

63-74: Nice implementation of dynamic breadcrumbs!

The conditional breadcrumb generation based on isCreate state looks solid. You're properly using the translation function for internationalization support.

One small concern though:

- { name: t("details"), path: `/status/uptime/${statusPage?.url}` },
+ { name: t("details"), path: `/status/uptime/${statusPage?.url || ''}` },

There's a potential edge case where statusPage could be undefined when the page is initially loading, which might create a path with "undefined" in it. Adding a fallback empty string would handle this case.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c16e51e and cae3d9e.

📒 Files selected for processing (3)
  • src/Pages/StatusPage/Create/index.jsx (3 hunks)
  • src/Pages/StatusPage/Status/index.jsx (3 hunks)
  • src/locales/gb.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/Pages/StatusPage/Status/index.jsx (2)
src/Pages/StatusPage/Create/index.jsx (1)
  • crumbs (64-66)
src/Pages/Uptime/Create/index.jsx (1)
  • crumbs (78-81)
src/Pages/StatusPage/Create/index.jsx (2)
src/Pages/StatusPage/Status/index.jsx (2)
  • crumbs (32-35)
  • statusPage (37-38)
src/Pages/Uptime/Create/index.jsx (1)
  • crumbs (78-81)
🔇 Additional comments (6)
src/locales/gb.json (1)

379-381: Awesome addition of localization strings for breadcrumbs!

These new key-value pairs will support the breadcrumb navigation in the Status Pages, making the UI more intuitive and international-friendly.

src/Pages/StatusPage/Create/index.jsx (2)

6-6: Good job importing the Breadcrumbs component!

Clean import of the Breadcrumbs component from the correct path.


235-235: Great placement of the Breadcrumbs component!

The Breadcrumbs component is properly positioned at the top of the stack, making it immediately visible to users for navigation.

src/Pages/StatusPage/Status/index.jsx (3)

10-10: Solid import of the Breadcrumbs component!

Clean import statement following project conventions.


32-35: Well-structured breadcrumb implementation!

The breadcrumb array is clearly defined with translated strings and appropriate paths. Good use of the translation function to ensure proper localization.


133-133: Smart conditional rendering of breadcrumbs!

Good decision to only show breadcrumbs in the admin view (!isPublic) and not in the public-facing status page. This keeps the public interface clean while providing navigation assistance for administrators.

@gorkem-bwl
Copy link
Contributor

The UI looks good, thank you. What happens when you click on "Status pages" or "Details"?

image

@gorkem-bwl gorkem-bwl requested a review from Owaiseimdad April 14, 2025 20:19
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for your contribution!

Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

Apologies for the second review, but the strings in the localisation file should be more descriptively named.

There's also a minor mege conflict to resolve.

Thank you!

"inviteNoTokenFound": "No invite token found",
"details": "Details",
"create": "Create",
"statusPages": "Status Pages"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's give these more descriptive names

statusBreadcrumbDetails
statusBreadcrumbCreate

sometning like that so it is obvious what these are for.

Copy link
Contributor

@Owaiseimdad Owaiseimdad left a comment

Choose a reason for hiding this comment

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

Also, please test once if we can do anything about the blink when you click on create or navigate back to the same page in status.

{ name: t("statusPages"), path: "/status" },
];
if (isCreate) {
crumbs.push({ name: t("create"), path: "/status/create" });
Copy link
Contributor

Choose a reason for hiding this comment

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

@nbgslv , I feel this has to be /status/uptime/create. Let me know if I am missing anything as we have no page which is /status/create.

try navigating to create page and click on create present in the breadcrumbs itself.

@@ -28,6 +29,10 @@ const PublicStatus = () => {
const { t } = useTranslation();
const location = useLocation();
const navigate = useNavigate();
const crumbs = [
{ name: t("statusPages"), path: "/status" },
{ name: t("details"), path: "" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally the detail's path should also be a link. Because lets say we have a new page after details in future then we should not worry about add a new url here, No empty string is needed. Good practice would be to add url to avoid confusion in future.

EX:

const crumbs = [
	{ name: t("statusPages"), path: "/status" },
	{ name: t("details"), path: `/status/uptime/${statusPage?.url}` },
];

@nbgslv
Copy link
Contributor Author

nbgslv commented Apr 16, 2025

The UI looks good, thank you. What happens when you click on "Status pages" or "Details"?

image

When you click on Status Pages, you are being redirected back to main Status Pages page. Clicking on Details redirects you to the details page of the specific status page you are currently viewing.

@gorkem-bwl
Copy link
Contributor

Perfect, thank you!

@nbgslv
Copy link
Contributor Author

nbgslv commented Apr 16, 2025

Also, please test once if we can do anything about the blink when you click on create or navigate back to the same page in status.

If we are talking about the rectangular shown, then this a skeleton set to be rectangular with 100% width and 100vh height. I think we better open an issue about it, asking to redesign the skeleton in status pages to look more similiar to the content being loaded(like in uptime page).
Screenshot 2025-04-16 202746

@nbgslv nbgslv requested review from Owaiseimdad and ajhollid April 16, 2025 17:40
"pageSpeedAddApiKey": "how to add your API key.",
"statusBredCrumbsDetails": "Details",
"statusBredCrumbsCreate": "Create",
"statusBredCrumbsStatusPages": "Status Pages"
Copy link
Collaborator

@ajhollid ajhollid Apr 16, 2025

Choose a reason for hiding this comment

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

Typo hear, Bred -> Bread

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6383d60

Thanks.

@nbgslv nbgslv requested a review from ajhollid April 17, 2025 15:07
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for your contribution! 🚀

@ajhollid ajhollid merged commit 66870f4 into bluewave-labs:develop Apr 17, 2025
1 check 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.

4 participants