Story #2560: implement the unavailable library page UI - #2578
Open
ycanales wants to merge 1 commit into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Replaces the placeholder on the v3 library subpage with the designed empty state: headline, a sentence naming the library and versions, a "Switch to ..." CTA and the bookshelf illustration, built on the shared library hero. - Add optional cta_label/cta_url/cta_icon_name to _hero_library.html, rendered through the existing hero button component - Add a hero--library-unavailable variant: page surface instead of the accent background, Figma's 32px content rhythm, bottom-flush illustration blended into the surface, and a min-height so the longer copy can't overflow the version alert in the tablet band - Build the sentence and CTA in the view, since both branch on data: a library with no releases has no "first release" clause and nowhere to switch to, and a library dropped from Boost points at its last release rather than latest - Skip the subpage card context entirely when the version is missing
ycanales
force-pushed
the
cy/2560-unavailable-library-page
branch
from
August 6, 2026 15:48
e674ea5 to
3dcd88b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #2560
Summary & Context
Replaces the inline placeholder on the v3 library subpage with the designed empty state for a library that has no version in the selected Boost release: headline, a sentence naming the library and versions, a "Switch to ..." CTA and the bookshelf illustration.
Changes
View (
libraries/views.py)LibraryDetail.get_missing_version_context(), which builds the sentence and the CTA label/URL. Both branch on data, so neither can live in the template: a library with no releases at all drops the "first release was ..." clause and gets no CTA, and the CTA targets the newest release that actually ships the library rather than always "latest".get_v3_context_data()now returns early for the missing-version case, so the subpage's contributor, quick-start, dependency and benchmark context is no longer computed for a page that renders none of it.Hero component (
templates/v3/includes/_hero_library.html)cta_label/cta_url/cta_icon_name, rendered through the existing_button_hero.htmlinside.hero__actions. The block collapses when they are absent, so every existing caller is unchanged.Empty state template (
templates/v3/includes/_library_version_unavailable.html, new)empty-library-light/dark.pngillustration already shipped for the library-list empty state. No new asset: it is the same artwork as the Figma frame.Styles (
static/css/v3/heros.css)hero--library-unavailablevariant: page surface instead of the hero's accent yellow, Figma's 32px rhythm between headline, sentence and CTA, and a bottom-flush illustration.min-heightfor this variant only, since the empty state's copy is longer than a library hero's and would otherwise overflow the CTA onto the version alert in the tablet band.multiply/screen. That needs a matching background on.hero__image, because.hero__blockopens a stacking context and closes the blending group above the section background.Tests (
libraries/tests/test_views.py)test_library_detail_missing_versionwithoverride_flag("v3", active=False). It was passing only on ambient flag state and flipped to the v3 template whenever the cached waffle flag was warm._hero_library.htmlcosts three optional variables and keeps the responsive type ladder, the theme-aware image swap and the version alert in one place. A separate template would have duplicated all three and drifted from the other heroes.VersionAlertMixin.get_version_alert_messagesets the precedent for keeping that branching in Python.alt=""on the illustration is deliberate. It is decorative here, and the<h1>and paragraph carry the message.Peer-Testing Guidelines
Both states are real Boost history, so every URL below works on any environment with the catalogue imported.
(Local only.) Check out the branch and apply the migrations that come with Story 2430: Library Subpage Integration #2524. Confirm the
v3waffle flag is active. If the page renders the legacy layout, the cached flag is stale:Default state: release older than the library's first. Boost.Beast first shipped in 1.66.0, so visit
/library/1.61.0/beast/. Expect the headline, the sentence naming both versions, a "Switch to latest (1.91.0)" button naming the current release, and the illustration on the page surface (not the yellow hero background). The button should land on/library/latest/beast/.Dropped library. Boost.Compatibility last shipped in 1.86.0, so visit
/library/latest/compatibility/. The button should read "Switch to 1.86.0" and link to/library/1.86.0/compatibility/, not back to latest.Responsive and themes. Resize through 1440 / 768 / 375 in both themes. The illustration should have no visible panel edge behind it in either theme, and at 768 the CTA must stay clear of the version alert banner.
No regression on a populated subpage. Visit
/library/latest/beast/and confirm the hero still shows the tag row and the Documentation / Source code / Slack / GitHub Issues links, with no CTA button.More examples, and how to find your own from the site or admin
Extra URLs for step 3, libraries added recently enough that older releases predate them:
/library/1.85.0/decimal//library/1.80.0/cobalt//library/1.80.0/mysql/Extra URLs for step 4, libraries dropped from Boost, all visited at
latest:/library/latest/functionalhash//library/latest/mathquaternion//library/latest/signals/To find your own without database access:
latest. The hero carries an "Added in {version}" chip, and picking any older release from the version dropdown lands on the step 3 state./admin/libraries/libraryversion/. The list shows every release that ships the library, newest first. If the top row is below the current Boost release the library is a step 4 candidate, and that row is the version the CTA should target.Screenshots
Drag the matching file from
claudetmp/pr-2560/into each cell.Self-review Checklist
Frontend
<h1>carries the message, the CTA is a plain focusable link, the illustration is decorative (alt="")