# Sections and collections

## Organizing pages into sections

The sidebar can group pages under named sections that open and close. Pages and sections are arranged right in the sidebar. Right-click an empty part of the sidebar, or a section's header, and choose **New Section**.

Drag a page anywhere in the sidebar: among a section's pages, or just under its header, puts it in that section (an empty or closed one too), and above every header takes it out again.

Or right-click a page and choose **Move to… → Sections**: pick a section, choose **New Section** to start one with that page, or **Ungrouped Pages** to put it back in the top list. An empty section shows **Drag pages here** under its header.

Ungrouped pages come first, then each section in order: drag a section's header to move the section, its pages with it.

Click a section's header to close or open it (an arrow appears when you point at it); Legato remembers the choice.

Right-click a section header and choose **Edit…** to change its name and give it an icon, or **No icon** to show its name alone; **Remove Icon** in the same menu takes an icon away. **Delete Section** keeps its pages and returns them to the ungrouped list. Drag pages or section headers to reorder them. **Move to…** offers sections and collections without dragging. Right-click a page and choose **Edit…** to rename it or choose its icon, or **No icon**. The editor opens under what it edits. Save, Return or a click outside it writes the new `title` and `icon` into the page's file, as an agent's `set_page` would; Cancel or Escape changes nothing, and closing it unchanged writes nothing. **Choose Icon…** shows the icon picker in the editor's place.

The window opens on the page last viewed. To open it on the same page every time, right-click that page and choose **Home Page**, or pick it under **Open on** in [Settings → Pages](https://legatobar.com/docs/settings.md#pages). Pages opened from Spotlight, Shortcuts or a notification still open on their own, and Back returns from the home page to the page left. Renaming a page keeps it home. A home page whose file goes away, deleted or renamed (its id comes from the file name), isn't forgotten: the window opens on the last page viewed until a page with that id is back. Deleting it with **Delete Page…** clears it.

A section's name is up to 40 characters. Sections and order are kept by page id, outside the page files, so an agent rewriting a page never moves it, and a page deleted and written again lands back in its section. A page's name and icon are its own `title` and `icon`: an agent that rewrites the page with another title renames it.


## Collections

Collections give the sidebar separate sets of pages and sections, up to nine. Choose **New Collection** from the sidebar's right-click menu or the chevron menu beside the sidebar toggle, then give it a name and an icon. The first collection, **Pages**, keeps your existing arrangement. Your new collection starts empty.

Click a collection's icon to return to the page you last viewed there. Up to four icons sit beside the sidebar toggle, the current one always among them. The chevron after them shows the rest, each with its icon and ⌘ shortcut. With the panel open, ⌘1 through ⌘9 select them in order. Save or cancel an event draft before switching.

Right-click a page or section and choose **Move to… → Collections**. Moving a section brings its pages with it; moving one page puts it at the top of its destination's ungrouped pages. You can also drag a page or section onto a collection icon. Dropping it onto its current collection leaves its placement alone. The Move menu reaches every collection, including ones whose icons don't fit.

Right-click an icon and choose **Edit…** to change its name and icon, or use its menu to move it left or right, or delete it. Drag one collection icon onto another to put it in that one's place. Deleting a collection moves its contents into the original collection and never deletes page files. The original collection can't be deleted. **Undo Delete Collection** is in the chevron menu until you make another preferences change.

Choose **Settings → General → New pages go to** to set the destination for new sidebar pages. You can also right-click a collection icon and choose **Use for New Pages**. This affects pages when Legato first loads them; existing pages keep their placement, including when an agent updates them. Deleting that destination resets it to the original collection. Detail pages do not get a collection. Following a link to a sidebar page switches to its collection; a detail page keeps the collection you came from. Back and Forward remember that context. An empty collection shows an empty page area.

Collections, their order and their last-viewed pages stay on this Mac. They don't change page JSON, fetching or notification settings.

The icon editor has a searchable browser with categories and recent choices. Search ordinary words such as “home”, “money” or “server”, then choose an icon and save the collection. **Use a symbol name** is optional, for symbols outside the bundled catalog.

Agents can arrange collections and sections too: `get_sidebar`, `set_collection`, `set_section`, `move_page`, `delete_collection` and `delete_section` (or `legato sidebar` and `legato arrange`), described in [Arranging the sidebar](https://legatobar.com/docs/mcp-tools.md#arranging-the-sidebar). They never change or delete page files. Collection placement stays out of page JSON.

