Skip to content

Add "back to book" button on gameboards#2193

Merged
sjd210 merged 25 commits into
mainfrom
hotfix/back-to-book-button
Jun 19, 2026
Merged

Add "back to book" button on gameboards#2193
sjd210 merged 25 commits into
mainfrom
hotfix/back-to-book-button

Conversation

@axlewin

@axlewin axlewin commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

If a gameboard is accessed from a book page, show a "Back to book section" button in the sidebar that links back to the book page.

axlewin added 6 commits June 3, 2026 17:26
To facilitate a "back to book" button
A "back to subject overview" button might be a good idea, but it adds additional complexity and nobody's asked for it.
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.58065% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.51%. Comparing base (1243b84) to head (23a8b26).
⚠️ Report is 50 commits behind head on main.

Files with missing lines Patch % Lines
...pp/components/elements/sidebar/SidebarElements.tsx 23.07% 10 Missing ⚠️
src/app/components/pages/Question.tsx 0.00% 8 Missing ⚠️
...nents/elements/sidebar/GameboardContentSidebar.tsx 14.28% 6 Missing ⚠️
...c/app/components/elements/list-groups/ListView.tsx 63.63% 4 Missing ⚠️
...ponents/elements/sidebar/RelatedContentSidebar.tsx 20.00% 4 Missing ⚠️
src/app/components/pages/Concept.tsx 0.00% 4 Missing ⚠️
src/app/components/pages/Gameboard.tsx 20.00% 4 Missing ⚠️
src/app/components/elements/BookPage.tsx 0.00% 3 Missing ⚠️
src/app/components/pages/Generic.tsx 0.00% 3 Missing ⚠️
...p/components/elements/sidebar/GameboardSidebar.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2193      +/-   ##
==========================================
- Coverage   43.55%   43.51%   -0.04%     
==========================================
  Files         597      597              
  Lines       25207    25253      +46     
  Branches     8389     8421      +32     
==========================================
+ Hits        10979    10989      +10     
- Misses      14172    14207      +35     
- Partials       56       57       +1     

☔ View full report in Codecov by Harness.
📢 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.

@sjd210 sjd210 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wasn't here for the tech meeting discussion, but I'd imagine that content also want the button to still be on the question deck when navigating to a question, then back to the deck. There are a few different links that do this, but it should mostly just be propagating the url parameter in those different places too, which seems reasonable.

Also this definitely wasn't requested, but I imagine this would be also be useful for concept pages which are also very commonly linked from book pages. Maybe something to mention?

<ListView
type="gameboard"
items={convertToALVIGameboards(page.gameboards as GameboardDTO[])}
items={convertToALVIGameboards(page.gameboards as GameboardDTO[], window.location.pathname)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I really don't like us embedding so much of one url into another url. The slashes make it difficult to figure out where the actual pages url ends and this one begins at a glance, and it just makes things unnecessarily long.

We could certainly slice the /books/ from the front since these are only ever meant to link to book pages so we definitely know to include it. We could maybe then also split the ?book=$book/$section into ?book=$book&section=$section although then that's a tradeoff between clarity and length so I'm not 100% sold. I'll leave that to you.

};

type ALVIGameboard = GameboardDTO & {type?: string};
type ALVIGameboard = GameboardDTO & {type?: string} & {linkedBookPath?: string};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason we call it bookPagePath in other files but linkedBookPath here? It feels easier to track use if we stick with one consistent name

@sjd210 sjd210 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hate to be feature-creeping this - but for consistency, we probably should also apply this to wildcards.

Generic and Concept pages as wildcards in a gameboard have a GameboardContentSidebar for us to propagate this through, plus it'll need to be added to the ShortcutListViewItem.

Comment thread src/app/components/elements/sidebar/GameboardContentSidebar.tsx Outdated
Comment thread src/app/components/pages/Gameboard.tsx Outdated
Comment thread src/app/components/pages/Gameboard.tsx Fixed
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@axlewin

axlewin commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

we probably should also apply this to wildcards.

Hmm. I'm not against this in principle, but I'm not sure it works equally well for all wildcard types - for example where the wildcard is a generic content page we'd end up with something like this, which looks a bit odd. (Ignore me, I was using the wrong sidebar...yes, we ought to do this for wildcards too.)

@sjd210 sjd210 merged commit 401c00e into main Jun 19, 2026
10 checks passed
@sjd210 sjd210 deleted the hotfix/back-to-book-button branch June 19, 2026 14:49
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.

3 participants