zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Feature request) Keep sidebar width more consistent #3729

Open Chickenkeeper opened 1 year ago

Chickenkeeper commented 1 year ago

Describe feature

Currently the width of the sidebar is always set as a percentage of the window's width, which is an issue when switching between maximised and smaller window sizes or snapping to different areas of the screen. since the sidebar width needs to keep being readjusted to provide the most space for notes or avoid squishing the file tree.

Instead I propose setting the width of the sidebar to a fixed number of pixels on the screen, perhaps until the width of the window falls below e.g. a percentage of the screen's width, at which point it could fall back to the current method of scaling it relative to the width of the window. If the window is stretched back out above the threshold the sidebar's previous width would be restored, even if it's resized while below the threshold.

Resizing the sidebar while under the threshold could also update the threshold itself, so the sidebar could take up more or less of the window before the switch next occurs.

Additional Information

No response

Nriver commented 1 year ago

I would strongly recommend this widget trilium-left-panel-auto-zoom. You can hide the whole note tree to maximize your editing area. Then move your mouse on the left side, the tree will appear automatically. It's magic!

meichthys commented 1 year ago

@Chickenkeeper I agree. For small width viewports, we may be able to fall back to collapsing the sidebar all together - this may improve the mobile experience.