How it works › Open modes
Open modes
What touching a record does is one setting per view, with three modes: expand a band under the row, open the side peek, or link to the record's page. Like Notion's per-view "Open pages in", because one forced peek mode backfires (Atlassian had to add an opt-out to its preview panel).
Click a row
Liverobotparts' actuators. side: a click opens the peek, ↑/↓ step through the rows, Escape closes. expand: a band with the photo and the key specs opens under the row, several at once. link: the whole row goes to the part's page on robotparts.dev.
The live view starts when it scrolls into sight.
- type: table
name: All, flat
order: [model, brand, form, drivetrain, peak_torque, rated_torque, max_speed, mass, gear_ratio, voltage, od, length, buses, torque_density, price, sellers, level]
sort:
- { property: brand, direction: ASC }
- { property: model, direction: ASC }From the example robotparts actuators
<data-views src="views.base" open="side"></data-views>Write it
open: side # the file's default for every view
views:
- type: table
name: Expand in place
open: expand # this view's own mode
- type: table
name: Row links
open: { mode: link, url: url } # the page URL is the url property
- type: cards
name: Gallery
open: { mode: side, splitAt: 1100 }The view's key wins over the attribute, which wins over the file's top level; with nothing set it is {mode: side, splitAt: 1100}. The page URL is open.url, else the dataset's linkProperty. No URL, no drill-down: no title link and no "Open page".
Every mode
- A real link underneath. With a URL the title cell is a real
<a href>: ⌘/Ctrl/middle click opens a tab, as it should. A double-click or Enter opens the page. - side is responsive. At least
splitAtpx wide, the pane docks on the right and the list narrows beside it; narrower, it overlays; on a phone it is full screen with ‹ Back. - The peek is in the URL.
#peek=<id>is pushed when it opens, so Back closes it and a shared link reopens it. - Keyboard. ↑/↓ or j/k step to the next record with the pane open; Space opens the peek, toggles a band, or ticks the row in link mode; Escape closes.
Comes from docs/CONTRACT.md §13 (open modes) and docs/peps/0003-open-modes.md in docs/.