Skip to content

Book Navigation Headings #1485

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 4 commits into from
May 29, 2025
Merged

Book Navigation Headings #1485

merged 4 commits into from
May 29, 2025

Conversation

jacbn
Copy link
Contributor

@jacbn jacbn commented May 27, 2025

(dependent on https://github.com/isaacphysics/isaac-react-app/tree/redesign/general-improvements-10 – merge this first)

Implement the navigation menu at the top of book pages as seen in the original designs. Bumps Extension Work to the same level of header as Questions and Review to allow this.

Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 40.45%. Comparing base (488bc6b) to head (6b7ab0b).
Report is 5 commits behind head on redesign-2024.

Files with missing lines Patch % Lines
src/app/components/elements/BookPage.tsx 20.00% 4 Missing ⚠️
...c/app/components/elements/layout/SidebarLayout.tsx 0.00% 2 Missing ⚠️
...c/app/components/elements/list-groups/ListView.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           redesign-2024    #1485      +/-   ##
=================================================
- Coverage          40.45%   40.45%   -0.01%     
=================================================
  Files                495      495              
  Lines              22141    22145       +4     
  Branches            7342     7344       +2     
=================================================
+ Hits                8958     8959       +1     
- Misses             12558    13149     +591     
+ Partials             625       37     -588     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

<h3 className="mb-3"><Markup encoding="latex">{page.title}</Markup></h3>
<div className="content-metadata-container d-flex flex-column gap-2">
{!!page.gameboards?.length && <BookSectionLink id="questions" title="Questions" />}
{!!page.relatedContent?.length && <BookSectionLink id="review" title="Review" />}
Copy link
Contributor

@sjd210 sjd210 May 28, 2025

Choose a reason for hiding this comment

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

Currently the Review heading covers both page.relatedContent and page.children (and is always present on the page).

If it's meant to be there regardless, so should this link. If its only meant to head relatedContent, that heading should be moved to inside the conditional section. I haven't been part of discussions so I'm not entirely sure what's wanted, but it's not consistent right now either way. (e.g. There's no "Review" button on physics_skills_19/a9)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm yeah. Tbh, I'm not 100% myself on whether pages will always contain Review content – there's no requirement for them to in the content, they could just set IDs in gameboards and hit publish. We could make it show dependent on both the existence of related content and children.length, but children being empty isn't the only way no content can show – if all children are empty, nothing will appear...

I think it is okay to assume there will be something in the Review block; content will at least check the page and see the "Review" text, which should imply we're expecting it to be there.

Copy link
Contributor

@sjd210 sjd210 May 29, 2025

Choose a reason for hiding this comment

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

Yeah, I suppose that probably makes the most sense.

It does also now feel strange when "Review" is the only heading - maybe then it shouldn't be navigable to since it's already there on-page? Or perhaps keeping the menu around for consistency is better? I'm not sure - that's probably something worth checking with content (partly because I'm not sure how common it would be to have book pages without question decks once the books are all fully ported to this page type).

Also I didn't bring it up previously because it would get fixed by forcing Review to always be in the menu, but the div probably shouldn't be visible if it has no contents - now impossible, but it had been sticking around as an empty grey rectangle.

Regardless, functionality now seems all good so I'll merge this in and it'll be easier to discuss from there 🤷‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does also now feel strange when "Review" is the only heading

I do agree, but you can align a section under a "Review" heading with any other page's Review section (even if that one had a section above it) more easily, so for consistency I think we should keep it.

@sjd210 sjd210 merged commit 5b8ddb7 into redesign-2024 May 29, 2025
8 checks passed
@sjd210 sjd210 deleted the redesign/book-nav-headings branch May 29, 2025 15:30
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