Skip to content

Story 2421: Add Master and Develop Buttons to Library Page & Library Sub-page#2500

Open
javiercoronadonarvaez wants to merge 6 commits into
developfrom
javiercoronarv/add-master-develop-buttons
Open

Story 2421: Add Master and Develop Buttons to Library Page & Library Sub-page#2500
javiercoronadonarvaez wants to merge 6 commits into
developfrom
javiercoronarv/add-master-develop-buttons

Conversation

@javiercoronadonarvaez

@javiercoronadonarvaez javiercoronadonarvaez commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Issue: #2421

Summary & Context

Adds small, intentionally unobtrusive Master ("M") / Develop ("D") branch buttons to the library page and library sub-page, per Rob's approved design. The buttons switch the on-site Boost version (master/develop) — the original ticket scoped these as navbar version-dropdown entries, but the approved direction is two standalone buttons instead.

Changes

  • Added a git-branch pixel-art icon to the shared icon component (templates/includes/icon.html).
  • New reusable partial templates/v3/includes/_branch_buttons.html rendering the M/D buttons. It is page-agnostic — URLs are derived from the current view via the existing branch_url_tag template tag (swaps the version_slug), so the same partial works on the list and detail pages. Full words "Master"/"Develop" are exposed via title + aria-label.
  • New stylesheet static/css/v3/branch-buttons.css (button styling using design tokens, plus the sub-page hero placement/alignment rules for desktop and mobile).
  • Library page (templates/v3/library_page.html + static/css/v3/library-page.css): buttons placed at the far right of the filter toolbar row (.library-page__filter-row).
  • Library sub-page (templates/v3/libraries/library-subpage.html + templates/v3/includes/_hero_library.html): buttons rendered in the hero as a direct child of __main, far-right and bottom-aligned with the actions row (right edge aligned to the content cards below; left-aligned and stacked on mobile). Gated behind a new show_branch_buttons flag so the four other pages that share _hero_library.html (community, release, examples) do not render them.

‼️ Risks & Considerations ‼️

Please list any potential risks or areas that need extra attention during review/testing

  • No backend changes. Version/URL/cookie behavior reuses existing infrastructure: the buttons link through branch_url_tag → the libraries-list / library-detail views → set_selected_boost_version. Verified that navigating sets/clears the boost_version cookie (master/develop set it, latest clears it).
  • Shared hero partial. _hero_library.html is used by community / release / examples pages too — the buttons are gated behind show_branch_buttons (passed only from the sub-page). Worth confirming the buttons appear only on the two intended pages.
  • Labels. Per the approved design the buttons show only the "M"/"D" letter badges (the AC text said "Master"/"Develop"); the full words are provided via title/aria-label. Confirmed as the convention going forward.

Screenshots

Library Page Functionality

LibraryPageFunctionality.mov

Library Page Responsiveness and Modes

LibraryPageResponsivenessAndModes.mov

Library Sub Page Functionality

LibrarySubPageFunctionality.mov

Library Sub Page Responsiveness and Modes

LibrarySubPageResponsivenessAndModes.mov

Self-review Checklist

  • Tag at least one team member from each team to review this PR
  • Link this PR to the related GitHub Project ticket

Frontend

  • UI implementation matches Figma design
  • Tested in light and dark mode
  • Responsive / mobile verified
  • Accessibility checked (keyboard navigation, etc.)
  • Ensure design tokens are used for colors, spacing, typography, etc. – No hardcoded values
  • Test without JavaScript (if applicable)
  • No console errors or warnings

Summary by CodeRabbit

  • New Features
    • Added Master/Develop branch-switch button controls to the library hero and filter toolbar area.
    • Added a dedicated Git branch icon for the branch switch links.
  • Style
    • Introduced dedicated responsive styling for the branch button group (desktop alignment, mobile stacking).
    • Added hover border behavior and visible :focus-visible keyboard focus outlines.
  • Accessibility
    • Added aria-label text, role="group" for the switch control, and an aria-hidden decorative badge letter.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 63d70835-adc3-4265-aff4-06dd1dfc84f4

📥 Commits

Reviewing files that changed from the base of the PR and between a1e2684 and bc9d342.

📒 Files selected for processing (9)
  • libraries/templatetags/branch_url_tag.py
  • static/css/v3/branch-buttons.css
  • static/css/v3/components.css
  • static/css/v3/library-page.css
  • templates/includes/icon.html
  • templates/v3/includes/_branch_buttons.html
  • templates/v3/includes/_hero_library.html
  • templates/v3/libraries/library-subpage.html
  • templates/v3/library_page.html
🚧 Files skipped from review as they are similar to previous changes (4)
  • templates/v3/includes/_hero_library.html
  • static/css/v3/library-page.css
  • static/css/v3/branch-buttons.css
  • templates/includes/icon.html

📝 Walkthrough

Walkthrough

Adds branch-switch button rendering for library pages and library subpages, including a new icon path, shared CSS, and template wiring for the page filter row and hero area.

Changes

Branch buttons UI

Layer / File(s) Summary
Branch button markup
templates/v3/includes/_branch_buttons.html, templates/includes/icon.html, libraries/templatetags/branch_url_tag.py
Adds the Master and Develop branch-button partial, builds its URLs from request.resolver_match, adds the git-branch icon case, and stops mutating the incoming kwargs dict in the URL tag.
Branch button styling
static/css/v3/branch-buttons.css, static/css/v3/components.css
Defines the branch-button layout, square/icon/badge styling, hover and focus states, hero placement rules, and imports the new stylesheet.
Library page integration
templates/v3/library_page.html, static/css/v3/library-page.css
Adds the filter-row flex layout and renders the branch buttons next to the existing library filter.
Hero and subpage integration
templates/v3/libraries/library-subpage.html, templates/v3/includes/_hero_library.html
Adds the show_branch_buttons flag, passes it from library subpages, and conditionally includes the branch-button partial in the hero layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

A little rabbit hops through code,
With branchy buttons on the road 🐇
Master, Develop, side by side,
In hero glow and filter stride.
Nibble, click, and off I go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Master and Develop buttons to the library page and sub-page.
Description check ✅ Passed The description follows the template closely and includes issue, context, changes, risks, screenshots, and checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch javiercoronarv/add-master-develop-buttons

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

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

@javiercoronadonarvaez javiercoronadonarvaez force-pushed the javiercoronarv/add-master-develop-buttons branch 2 times, most recently from 50439db to 5b6861e Compare June 24, 2026 16:37
@javiercoronadonarvaez javiercoronadonarvaez marked this pull request as ready for review June 24, 2026 19:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/v3/includes/_branch_buttons.html`:
- Around line 24-30: The branch button template is passing
request.resolver_match.kwargs directly into branch_url_tag, and that tag mutates
the dict in place, so update the _branch_buttons.html calls to pass a copy
instead of the original kwargs. Use the existing branch_url_tag invocations for
the master and develop buttons as the fix point, ensuring any version_slug
changes stay isolated to the tag and do not leak into later template rendering.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: beb8cac0-a9ab-489f-ac22-98e326efdfd5

📥 Commits

Reviewing files that changed from the base of the PR and between c40f9d5 and c89f346.

📒 Files selected for processing (7)
  • static/css/v3/branch-buttons.css
  • static/css/v3/library-page.css
  • templates/includes/icon.html
  • templates/v3/includes/_branch_buttons.html
  • templates/v3/includes/_hero_library.html
  • templates/v3/libraries/library-subpage.html
  • templates/v3/library_page.html

Comment thread templates/v3/includes/_branch_buttons.html

@julhoang julhoang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @javiercoronadonarvaez , this works great! I just left some nit comments around inline documentations, and I think the quick-win suggestion from CodeRabbit is also worth tackling – pre-approving now!

Comment thread static/css/v3/branch-buttons.css Outdated
/*
Branch Buttons
Small, unobtrusive Master ("M") / Develop ("D") branch links.
Bordered icon square with an amber corner badge. Matches Figma node 7696:45822.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Can we remove the Figma node reference?

Comment thread static/css/v3/branch-buttons.css Outdated
Comment on lines +73 to +89
/* In the library sub-page hero the buttons are a direct child of __main
(sibling of the content column), pinned to the far right and bottom-aligned
with the actions row — matching Figma node 7146-55502 (hero is items-end).
The right edge is inset by --space-large so it lines up with the right edge
of the content cards below (.library-subpage-container has 16px side padding).
Figma node 7696-45623. */
.hero-library__main > .branch-buttons {
align-self: flex-end;
flex-shrink: 0;
margin-right: var(--space-large);
}

/* Mobile: __main becomes a column, so the buttons stack below the actions row.
Left-align them with the cards' left edge (block + cards both pad 8px here)
and add a little separation. Figma node 7611-62006. */
@media (max-width: 767px) {
.hero-library__main > .branch-buttons {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: I think both of these comments are a little long, can we trim them down or remove them?

{% block extra_head %}
{{ block.super }}
<link href="{% static 'css/v3/library-subpage.css' %}" rel="stylesheet">
<link href="{% static 'css/v3/branch-buttons.css' %}" rel="stylesheet">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Per our current convention, new component CSS goes in v3/components.css. Could you move this import there to keep things consistent? With that change, we should also be able to remove the import on the library_page.html

Comment on lines +3 to +9
V3 Branch Buttons — two small, unobtrusive links that switch the current page
to the Master / Develop Boost version, per Rob's approved design (Figma node
7696:45822).

Each button is a bordered icon square with a small amber corner badge showing
a single letter ("M" / "D"). The full words "Master" / "Develop" are exposed
via title + aria-label for accessibility (the AC requires those exact words).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
V3 Branch Buttons — two small, unobtrusive links that switch the current page
to the Master / Develop Boost version, per Rob's approved design (Figma node
7696:45822).
Each button is a bordered icon square with a small amber corner badge showing
a single letter ("M" / "D"). The full words "Master" / "Develop" are exposed
via title + aria-label for accessibility (the AC requires those exact words).
V3 Branch Buttons

To me some of the detail in these 2 paragraphs seem a bit heavy and can easily go out-of-date (the Figma node ids plus the process/ticket context like "per Rob's approved design" and "the AC requires those exact words"). Can we consider trimming this down to just the non-obvious why that a future reader of the code needs (why the buttons are gated behind show_branch_buttons, why we swap version_slug) and dropping the node refs + approval/AC notes, since those live better in the PR/ticket and go stale once the design or scope moves? Does this seem reasonable to you?

Comment thread templates/v3/includes/_branch_buttons.html
@javiercoronadonarvaez javiercoronadonarvaez force-pushed the javiercoronarv/add-master-develop-buttons branch from c89f346 to 3ac9021 Compare June 24, 2026 22:57

@jlchilders11 jlchilders11 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, just a few things to get it ready to merge.

It looks like Julia caught everything that I would mention, but for me the Rabbit comment on mutating the kwargs and the location of the css are actual stoppers for approval. Once those are addressed happy to approve.

@javiercoronadonarvaez javiercoronadonarvaez force-pushed the javiercoronarv/add-master-develop-buttons branch from 3ac9021 to 03683db Compare June 25, 2026 17:46
@javiercoronadonarvaez

Copy link
Copy Markdown
Collaborator Author

@julhoang @jlchilders11

Thanks for all your suggestions, which were addressed in the last 3 commits.

It is ready for another review.

@javiercoronadonarvaez javiercoronadonarvaez force-pushed the javiercoronarv/add-master-develop-buttons branch from 3747142 to bc9d342 Compare June 30, 2026 16:11
@herzog0 herzog0 self-requested a review July 2, 2026 17:03

@herzog0 herzog0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All looking good to me, thanks @javiercoronadonarvaez !

@julhoang julhoang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the updates @javiercoronadonarvaez ! This looks great 🙌

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.

Task: Add Master and Develop Buttons — Library Page & Library Sub-page

4 participants