Fix the dead Firefox sidebar pill and off-centre sidebar panels - #7
Merged
Merged
Conversation
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.
firefox refuses sidebarAction.open() outside a user input handler, and the gesture does not survive a runtime.sendMessage hop, so the in-page "open sidebar" pill did nothing on firefox and the refusal landed only in the background console. fourteen templates shipped that pill, so the page looked like a dead button.
on gecko builds the pill now renders static content naming the toolbar action, which is the route that works and the one every template's first steps already documents. chromium keeps today's working pill, unchanged. the background listener that could never work is gone from gecko output.
the new tab page button in newtab-browser-flags had the same problem through the same background listener. an extension page is itself a user input handler, so that button now calls sidebarAction.open() directly and genuinely opens the sidebar on firefox. a content script cannot do that, which is why the pill had to go static instead.
six templates also tested only for firefox and missed gecko forks, so every touched surface now tests firefox or gecko-based.
separately, eight sidebar stylesheets set height: 100vh together with a margin on body. a box a full viewport tall and then pushed down by its own margin sits half the margin below centre and overflows by twice the margin, which overflow: hidden then hid. they now subtract the margin from the height.
verified on real headless firefox against example.com: the pill renders as a div with cursor default and no aria-label, a click adds no error line to the log, and no refusal is raised. in built output the firefox bundle carries the hint and contains "open sidebar", aria-label and sendMessage zero times, while the chrome bundle keeps all three. sidebar centring measures 0.0px off centre with no overflow at four panel heights.
a new check keeps a clickable pill out of gecko output, keeps the message listener from coming back, and fails any sidebar stylesheet that combines a viewport height with the margin