Repository navigation
Keep the window from sliding up under the title bar - #109
Merged
Merged
Conversation
The sidebar and its resize handle were 100vh tall, but they sit in the app container, which ends above the 22px status bar. So the container's content ran 22px past it, and overflow: hidden still let a focus() or scrollIntoView() scroll it: the whole window then slid up 22px, cutting off the top of the sidebar and the project header, and stayed that way. The last 22px of the sidebar lists were also always hidden. The sidebar and the handle now take the container's height, and the container uses overflow: clip, so nothing can scroll it.
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.
Summary
Every so often the whole window slides up by 22px and stays there: the top of the sidebar (its tab icons) and the top of the main view (the project header, or the strip with Overview / Tasks / New session while working in a project) end up cut off under the macOS title bar. This fixes it, and with it the last 22px of the sidebar lists, which were always hidden behind the status bar.
Why
#sidebarand#sidebar-resize-handleareheight: 100vh, but they sit in#app-container, which is the body's flex child above the 22px#status-bar. So the container's content is 22px taller than the container:#app-containeris 846px high, itsscrollHeightis 868, the sidebar ends at 868 and the status bar starts at 846;#app-containerhasoverflow: hidden, which hides the extra 22px but still lets script scroll it. Anyfocus()orscrollIntoView()that lands on something in those 22px scrolls every scrollable ancestor, this container included, and the whole UI shifts up 22px until the window is reloaded. In the running app this happens on its own after a while (there are severalscrollIntoView({ block: 'nearest' })andfocus()calls in the renderer).The released 0.0.36 has the same CSS, so it is not specific to a branch.
What it does
public/style.cssonly:#sidebar:height: 100vh→min-height: 0, so it takes the container's height (the flex row stretches it);#sidebar-resize-handle:height: 100vhremoved, same reason;#app-container:overflow: hidden→overflow: clip.cliphides overflow the same way but makes the element not a scroll container, so nothing can scroll the app shell even if something overflows it again later.Testing
Manual check on macOS in the running app (
electron .with an isolatedSWITCHBOARD_DATA_DIR), with the same probe run before and after:#app-containerheight /scrollHeightscrollTopafterapp.scrollTop = 999scrollTopafterscrollIntoView()on an element at the sidebar's bottomscrollTopafterfocus()on an input at the sidebar's bottomBefore, the shifted state looks exactly like the bug (sidebar icons and project header cut at the top); after, the sidebar lists end right above the status bar and their last row is fully visible. The collapsed sidebar is unaffected (it has no height rules of its own).
npm test: the only failures are the twoincremental columns upgrade a version-4/12 database…tests, which fail the same way on currentmainon my machine.