Skip to content

fix(docs): remove dead docs breadcrumb segment filter#6427

Open
BABTUNA wants to merge 2 commits intoreflex-dev:mainfrom
BABTUNA:fix-docs-breadcrumb-dead-filter
Open

fix(docs): remove dead docs breadcrumb segment filter#6427
BABTUNA wants to merge 2 commits intoreflex-dev:mainfrom
BABTUNA:fix-docs-breadcrumb-dead-filter

Conversation

@BABTUNA
Copy link
Copy Markdown
Contributor

@BABTUNA BABTUNA commented Apr 30, 2026

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

Follow-up to #6359.

breadcrumb(...) still had a hard-coded segment != "docs" filter even though docs paths are normalized earlier. That condition is now dead and can hide a valid segment mapping if a docs-prefixed path is passed through.

This PR removes that special-case filter so breadcrumb segments are derived uniformly from non-empty path segments.

Tests

Added regression test:

  • docs/app/tests/test_breadcrumb.py::test_breadcrumb_keeps_docs_segment_when_present_in_path

Validation run:

  • uv run --no-sync ruff check docs/app/reflex_docs/templates/docpage/docpage.py docs/app/tests/test_breadcrumb.py
  • uv run --no-sync pytest docs/app/tests/test_breadcrumb.py -q
  • uv run --no-sync pytest docs/app/tests/test_routes.py -q

@BABTUNA BABTUNA requested review from a team and Alek99 as code owners April 30, 2026 06:40
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

Removes the hard-coded segment != "docs" filter from the breadcrumb list comprehension in docpage.py, following up on #6359 which already normalises doc paths earlier in the pipeline. A regression test is added to confirm the "docs" segment is no longer silently dropped when it appears in a path.

Confidence Score: 4/5

Safe to merge; the only finding is a stale comment left over from the removed filter.

Change is minimal and well-motivated. Routes confirmed to never carry a /docs prefix in normal operation, so the removed filter was genuinely dead. Only a P2 stale-comment issue found.

No files require special attention.

Important Files Changed

Filename Overview
docs/app/reflex_docs/templates/docpage/docpage.py Removes dead segment != "docs" filter from the breadcrumb segment list comprehension; stale comment on href-building loop left unchanged.
docs/app/tests/test_breadcrumb.py New regression test verifying that "docs" is no longer special-cased out of breadcrumb segments when present in the path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["breadcrumb(path, ...)"] --> B["path.split('/')"]
    B --> C{"filter segments"}
    C -- "Before (old)" --> D["segment and segment != 'docs'"]
    C -- "After (new)" --> E["segment (non-empty only)"]
    D --> F["capitalize → segments list\n(docs always excluded)"]
    E --> G["capitalize → segments list\n(docs included if present)"]
    F --> H["Build href + render breadcrumb items"]
    G --> H
Loading

Comments Outside Diff (1)

  1. docs/app/reflex_docs/templates/docpage/docpage.py, line 620 (link)

    P2 Stale comment after filter removal

    The inline comment still says "paths are app-relative, no /docs prefix", but that note only made sense when the segment != "docs" filter was in place. Now that the filter is gone, the /docs prefix can appear in segments, so the comment is misleading and should be updated or dropped.

Reviews (1): Last reviewed commit: "fix(docs): remove dead breadcrumb docs s..." | Re-trigger Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 30, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing BABTUNA:fix-docs-breadcrumb-dead-filter (50f0379) with main (ada8c53)2

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (c593a7d) during the generation of this report, so ada8c53 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@adhami3310 adhami3310 added the documentation Improvements or additions to documentation label Apr 30, 2026
masenf
masenf previously approved these changes May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants