A TOC is intended as an index for the reader of a printed book. Since printed material is fixed, frozen, it does not make sense to collapse or expand a level (printed paper cannot change).
What you a re looking for is some navigation tool inside your document. Open the side pane. You access it with View
>Sidebar
or Ctrl+F5. Click on the “compass” icon to access the Navigator.
The first item in the Navigator list is Headings.
Provided your chapter headings and other divisions are style Heading n (which is probably the case because you could build a TOC), these headings are displayed there. Whenever a heading is the head of other subdivision, its contents is preceded by a small rotating triangular icon (or boxed +). Click on this icon to expand or collapse the level.
- (Optional) Right-click on Headings and
Collapse All
to close all headings
- Right-click again and
Show Up to Outline Level
>nn to filter how much you want to see
- Right-click and
Expand All
You can do it individually on each heading to control what is “beneath” it, thus showing different level of details in chapters.
To navigate quickly in your document, double-click on a heading to send the cursor there.
PS: whan asking here, always mention OS name, LO version and save format, due to subtle differences between platforms and possibilities in formats.