Skip to content

Make the layout of the search cancel button flexible#15

Closed
miccy wants to merge 1 commit intomainfrom
fix-flexible-search-cancel-button-1611425416413641314
Closed

Make the layout of the search cancel button flexible#15
miccy wants to merge 1 commit intomainfrom
fix-flexible-search-cancel-button-1611425416413641314

Conversation

@miccy
Copy link
Copy Markdown
Owner

@miccy miccy commented Apr 28, 2026

The search component in the documentation app had a hardcoded layout for the "Cancel" button on mobile viewports, which used absolute positioning and fixed offsets. This caused issues with localized translations where "Cancel" might be significantly longer or shorter than the English original.

This change transitions the .dialog-frame container to a CSS Grid layout. By using grid-template-columns: 1fr auto on mobile, the search input takes up the available space while the cancel button takes up only as much as it needs. To allow the deeply nested Pagefind UI elements to participate in this grid without breaking the library's required DOM structure, intermediate containers now use display: contents.

This approach removes the need for magic numbers and hardcoded spacing variables, making the UI more robust and internationalization-friendly.


PR created automatically by Jules for task 1611425416413641314 started by @miccy

Updated the search component layout to use CSS Grid, allowing the cancel
button to have a flexible width based on its content. This accommodates
different word lengths in localized translations.

- Replaced absolute positioning with CSS Grid on .dialog-frame.
- Used display: contents for intermediate search containers to allow
  nested elements to participate in the grid.
- Removed hardcoded --sl-search-cancel-space and width calculations.
- Added a Playwright test to verify layout flexibility.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 736b0c31-24f0-4d24-a1b9-1dd056b7bf27

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-flexible-search-cancel-button-1611425416413641314

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 and usage tips.

@miccy
Copy link
Copy Markdown
Owner Author

miccy commented May 4, 2026

✅ Merged into dev/feat-grant-ready-foundation (commit 0d7eb62).

@miccy miccy closed this May 4, 2026
@miccy miccy deleted the fix-flexible-search-cancel-button-1611425416413641314 branch May 4, 2026 03:23
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.

1 participant