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) Add ways to hide the TOC sidebar #2985

Closed abstractionmage closed 2 years ago

abstractionmage commented 2 years ago

Describe feature

The TOC sidebar for text notes added in v0.53.2 is always visible and taking up screen space. I wish there was a way to hide the TOC sidebar if it's not needed to make more efficient use of screen space, especially on small displays and/or when tiling the trilium window to the left or right half of the screen.

Additional Information

No response

zadam commented 2 years ago

Hi, that's true. I'm thinking there should be probably global on/off and then the ability to enable it per note I guess.

An alternative approach could be heuristic based on number of headings. If the number of headings is less than X, don't display TOC as it's not really needed. If there's more than X headings, display it.

WDYT?

abstractionmage commented 2 years ago

How about combining the heuristic approach with the per-note TOC visibility setting? For new notes, their default TOC visibility would be set to "auto" and follow the heuristic, but it could also be set to "visible" or "hidden" by the user. This would be similar to how the "Editable" note property works.

Global on/off sounds good to me as well, I just don't have any idea how exactly that setting should interact with the per-note setting (what should override what in which cases). On a personal level I'd appreciate the ability to globally hide the TOC sidebar so I can continue using antoniotejada's TOC Widget, but that's likely just a case-specific preference and and more related to the appearance of the new TOC sidebar than the ability to hide it 😅 I just don't have many notes with lots of headings, so I prefer having TOCs be part of the left sidebar :)

reefland commented 2 years ago

Global ON/OFF default would be great. I would always want it OFF and RARELY might toggle it ON for a very specific note.

I'm sure others would want a global ON with the option to turn it OFF occasionally. If a per-note TOC is undefined, then that note should uses the global default.

zadam commented 2 years ago

It's possible now (in master, future 0.54) to configure TOC globally:

image

It's also possible to force showing/hiding on invidual notes using #toc=show and #toc=hide.