Skip to content

Keep the window from sliding up under the title bar - #109

Merged
abasiri merged 1 commit into
doctly:mainfrom
vivi7:fix/app-shell-scroll
Nov 3, 2026
Merged

abasiri merged 1 commit into
doctly:mainfrom
vivi7:fix/app-shell-scroll

Conversation

@vivi7

@vivi7 vivi7 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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

#sidebar and #sidebar-resize-handle are height: 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:

  • measured in a 868px-tall window: #app-container is 846px high, its scrollHeight is 868, the sidebar ends at 868 and the status bar starts at 846;
  • #app-container has overflow: hidden, which hides the extra 22px but still lets script scroll it. Any focus() or scrollIntoView() 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 several scrollIntoView({ block: 'nearest' }) and focus() 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.css only:

  • #sidebar: height: 100vh → min-height: 0, so it takes the container's height (the flex row stretches it);
  • #sidebar-resize-handle: height: 100vh removed, same reason;
  • #app-container: overflow: hidden → overflow: clip. clip hides 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 isolated SWITCHBOARD_DATA_DIR), with the same probe run before and after:

    before after
    #app-container height / scrollHeight 846 / 868 846 / 846
    sidebar and handle bottom (status bar top: 846) 868 846
    scrollTop after app.scrollTop = 999 22 0
    scrollTop after scrollIntoView() on an element at the sidebar's bottom 22 0
    scrollTop after focus() on an input at the sidebar's bottom 22 0

    Before, 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 two incremental columns upgrade a version-4/12 database… tests, which fail the same way on current main on my machine.

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.
@abasiri
abasiri merged commit e594fa9 into doctly:main Nov 3, 2026
9 of 10 checks passed
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.

2 participants