Skip to content

refactor: Render booking pages in operator context#856

Open
MoritzWeber0 wants to merge 30 commits intomainfrom
fix/search-hidden-booking-sections
Open

refactor: Render booking pages in operator context#856
MoritzWeber0 wants to merge 30 commits intomainfrom
fix/search-hidden-booking-sections

Conversation

@MoritzWeber0
Copy link
Copy Markdown
Member

@MoritzWeber0 MoritzWeber0 commented Apr 18, 2026

This is a huge one. It completely changes the rendering logic of booking pages. Instead of displaying the rendered version of the booking page on the operator page, we do now render it on demand in the operator page context. With some additional changes in this PR, this will fix many issues:

  • Irrelevant sections of booking expanders are no longer rendered to the DOM. This fixes an issue where results where displayed in the search, but were not available on the page itself (see issue description below)
  • Images can be rendered out of context now. If you want to render the an image in another page context (for example to render a booking image on an operator page), just write:
    ![DB reservation booking](db_reservation.de.webp)
    {page="booking/db-website"}
    
  • Footnotes of booking expanders are finally scoped globally and are no longer rendered locally inside the expander
  • The heading map does now properly handle expanders, can be checked via the HeadingsMap extension
  • Content of the following expander doesn't count as element from the previous expander in the search (as there was no heading in between, so it counted as element of the last heading of the previous expander)
  • Train categories and booking platforms title matches are ranked higher in the search
  • If the result targets a booking or train category expander, the page automatically scrolls to it.
  • Similar to the already existing behavior with train category expanders, it's now possible to link to booking platforms directly, e. g. https://deploy-preview-856--fipguide.netlify.app/de/operator/oebb/#oebb-website works now.

Issue description

So far, we only hide some booking sections using display: none in the CSS of booking expanders. The issue is: Even if hidden, the content is still indexed for the search.

This PR changes the approach to no longer render the irrelevant sections to the DOM by storing the rendered sections in the page store.

Steps to reproduce the search issue:

  1. Search for "Website der Deutschen Bahn" on the German page
  2. Select "Reservierungen":
    grafik
  3. The section doesn't exist, no scrolling happens

Resolves #887
Resolves #462

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 18, 2026

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 9bcf07c
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/69efbac652c2b700089742f9
😎 Deploy Preview https://deploy-preview-856--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@MoritzWeber0 MoritzWeber0 marked this pull request as draft April 18, 2026 15:43
@MoritzWeber0 MoritzWeber0 linked an issue Apr 21, 2026 that may be closed by this pull request
@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review April 21, 2026 19:33
@MoritzWeber0 MoritzWeber0 requested a review from lenderom April 21, 2026 19:33
@MoritzWeber0 MoritzWeber0 requested a review from therobrob April 24, 2026 16:21
@MoritzWeber0 MoritzWeber0 marked this pull request as draft April 25, 2026 18:02
@MoritzWeber0 MoritzWeber0 force-pushed the fix/search-hidden-booking-sections branch from 07854df to f826006 Compare April 25, 2026 21:28
@MoritzWeber0 MoritzWeber0 changed the title fix: Remove hidden booking sections from search feat: Render booking pages in operator context Apr 25, 2026
@MoritzWeber0 MoritzWeber0 changed the title feat: Render booking pages in operator context refactor: Render booking pages in operator context Apr 26, 2026
@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review April 27, 2026 11:08
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.

Handling of expanders in search Check headings map on operator pages Remove single booking pages as direct links

1 participant