diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d26c4e3..2accf48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,29 @@ and listed with their assets on the ## [Unreleased] +### Added + +- **An order menu on the start page.** The same menu as the sidebar's (by + name, last opened first, last edited first; favourites always first) sits + in the filter row and orders the tiles and the list. The order is one + choice for the sidebar and the start page: choosing it in either shows in + both at once, where the start page used to take it only when it opened. +- **Small tiles and a list on the start page.** A switch beside the search + shows the stacks as large tiles (as before), as small tiles (the same tile, + closer together, without the time up and the ports shift) or as a list: a + table with a column each for state, services, lanes, time up, last commit + and what needs attention, sortable by its headers, with the star and the + favourite programs in each row; a click on a row opens the stack. The + search and the state filter apply in every view, and the choice is kept in + the browser. +- **A search and a state filter on the start page.** A field above the tiles + finds a stack by its name or its repository folder (every word typed must + match), and three chips, "All", "Running" and "Needs attention", each with + its count, narrow the tiles by state. `/` jumps to the field, Esc clears + it; text and state are still there after a visit to a stack and back. A + hidden stack stays out, but the line under the tiles says how many hidden + ones match what was typed. + ## [0.48.0] - 2026-11-16 The dashboard opens on a start page with every stack as a tile, a service diff --git a/docs/adr/0107-the-start-page-has-a-search-and-a-state-filter.md b/docs/adr/0107-the-start-page-has-a-search-and-a-state-filter.md new file mode 100644 index 00000000..7f0880e3 --- /dev/null +++ b/docs/adr/0107-the-start-page-has-a-search-and-a-state-filter.md @@ -0,0 +1,66 @@ +# ADR-0107: The start page has a search by name or folder and a filter by state + +- **Status:** Accepted (card in the pull request); built +- **Date:** 2026-11-17 +- **Deciders:** project owner +- **Related:** [ADR-0104](0104-the-start-page-shows-every-stack-as-a-tile.md) (the start page), [ADR-0102](0102-the-stacks-list-orders-by-last-commit-hides-stacks-and-filters.md) (the sidebar's filter), [ADR-0086](0086-favourite-stacks-list-first.md) (favourites), [ADR-0070](0070-a-review-card-comes-before-the-code-an-adr-records-what-was-built.md) + +## Context + +The start page shows every stack as a tile (ADR-0104). With many stacks there +was no quick way to find one, or to see only the ones that run or need +attention; the sidebar's filter (ADR-0102) is a click away from it and +reaches stacks and worktrees, not the tiles. + +## Decision + +The owner approved the points in the conversation on **2026-11-17** (with the +plan that carried them), after choosing that the search covers name and +folder, that the state filter is part of it, and that the page keeps a field +of its own: + +| # | Category | Point | Beats | Reversing costs | +|---|---|---|---|---| +| 1 | concept | The start page has a search field above the tiles; every word typed must be part of the stack's name or repository folder, whatever the case. | Sharing the sidebar's field, which would change the sidebar without cause. | Low: UI code only. | +| 2 | concept | Three state filters, "All", "Running" and "Needs attention", each with its count, combine with the text. | A search field alone, which cannot narrow by state. | Low: UI code only. | +| 3 | concept | The search finds the stack itself, not its worktrees. | Searching worktrees too, which needs every stack's lanes on this page (the sidebar reads them); it can be added later. | Low. | +| 4 | term | Text and state are kept in this tab's session storage, so the way to a stack and back through the "devstack" mark finds them as left. | Starting empty each time. | Low. | + +Decided on its own, not on the card: `/` focuses the field (unless a field +has the keys), Esc clears it and, once empty, leaves it; a hidden stack stays +out of the tiles, but while something is typed the line under them says how +many hidden stacks match, so a search never denies a stack that exists; a +filter with no match says so and offers "Clear the filter". + +As built: + +1. **The match.** `matchesQuery` (`ui/src/lib/stackOrder.ts`) is the stack's + own part of the sidebar's `filterStacks`, which now uses it, so both read + the words the same way. +2. **The state.** "Running" is a stack whose daemon runs, "Needs attention" a + stack with an item on the `attention` event, as the counts in the page's + head. The chips count the listed (not hidden) stacks, whatever is typed. +3. **The page.** `ui/src/views/HomeView.vue`; the text and the state are + `homeQuery` and `homeState` in `ui/src/stores/ui.ts`, saved in the session + storage as the sidebar's filter is. + +## Alternatives considered + +- **One field for the sidebar and the page.** One text for both, but typing + on the page would filter the sidebar and the other way round. +- **Searching worktrees as well.** Matches what the sidebar finds, at the + cost of reading every stack's lanes on the start page. + +## Consequences + +- A filter left on is still on when the page is opened again in the same + tab; the head's figures count every stack, the chips the listed ones. +- A stack that needs attention only through its own state (no item on the + `attention` event) is not counted by the chip, as it is not by the head. +- The page needs no new hub call. + +## Enforced by + +- `ui/src/views/HomeView.vue`, `ui/src/lib/stackOrder.ts` (`matchesQuery`), + `ui/src/stores/ui.ts` (`homeQuery`, `homeState`); tests in + `ui/src/views/HomeView.test.ts` and `ui/src/lib/stackOrder.test.ts`. diff --git a/docs/adr/0108-the-start-page-has-large-and-small-tiles-and-a-list.md b/docs/adr/0108-the-start-page-has-large-and-small-tiles-and-a-list.md new file mode 100644 index 00000000..26b8b42d --- /dev/null +++ b/docs/adr/0108-the-start-page-has-large-and-small-tiles-and-a-list.md @@ -0,0 +1,72 @@ +# ADR-0108: The start page shows the stacks as large tiles, small tiles or a sortable list + +- **Status:** Accepted (card in the pull request); built +- **Date:** 2026-11-17 +- **Deciders:** project owner +- **Related:** [ADR-0104](0104-the-start-page-shows-every-stack-as-a-tile.md) (the start page, its tile), [ADR-0107](0107-the-start-page-has-a-search-and-a-state-filter.md) (search and state filter), [ADR-0086](0086-favourite-stacks-list-first.md) (favourites), [ADR-0070](0070-a-review-card-comes-before-the-code-an-adr-records-what-was-built.md) + +## Context + +The start page (ADR-0104) shows every stack as a large tile. With many stacks +the large tiles take much room, and a column of figures to compare (which +stack was committed to last, which has the most lanes) is easier to read in a +table than in tiles. + +## Decision + +The owner approved the points in the conversation on **2026-11-17** (with the +plan that carried them), after choosing three views (large tiles, small +tiles, a list) and that the choice is kept in the browser: + +| # | Category | Point | Beats | Reversing costs | +|---|---|---|---|---| +| 1 | concept | The start page has three views of the same stacks: large tiles (as before), small tiles, a list. A switch beside the search chooses; the search and the state filter apply in each. | A page of its own for each view, which would repeat the filters. | Low: UI code only. | +| 2 | concept | The small tile is the same tile, closer together: name, state, folder, services, lanes, last commit and the first thing that needs attention; how long it has been up and the ports shift are left out. | A second tile component. | Low. | +| 3 | concept | The list is a table with the sortable column headers every table has: favourite star, name (folder below), state, services, lanes, up, last commit, attention, programs. Until a column is chosen the order is the tiles' (favourites first); a column's order applies in the list only. | One order for every view, which would take the sidebar's order from the tiles. | Low. | +| 4 | term | The views are "Large tiles", "Small tiles" and "List"; the choice is kept in this browser (local storage, as the sidebar's order and the favourites are), while the search text and the state stay with the tab (ADR-0107). | Keeping the view per tab. | Low. | + +Decided on its own, not on the card: a click on a row opens the stack (the +name is a link, the star and the programs do not open it); the attention +column is the number of items, its tooltip lists them; the "Up" column goes +on a narrow screen; the stack's folder is the second line of the name cell; a +stack without its stack file shows a warning mark beside its name. + +As built: + +1. **The figures.** `ui/src/lib/stackFigures.ts` (`stackFigures`) takes what + the tile worked out (state, services, lanes, since when it runs, last + commit, items) into plain values, with the state's `rank` for sorting; the + tile, the row and the sort read the same values. +2. **The tile.** `ui/src/components/StackTile.vue` has a `compact` prop for + the small tile. +3. **The row.** `ui/src/components/StackRow.vue`, a `` with `FavoriteOpeners` + and `StatusPill`. +4. **The page.** `ui/src/views/HomeView.vue`: the switch is `homeView` in + `ui/src/stores/ui.ts` (`devstack.home.view`); the list sorts with + `useSort` (`ui/src/lib/sort.ts`, kept as `devstack.sort.home`), by name, + state (the most urgent first), services, lanes, up (the longest first), + last commit (the newest first) or attention (the most first). + +## Alternatives considered + +- **A table as the only second view.** Less to build, but the small tiles keep + the overview's look at a third of the room. +- **Sorting the tiles by a column too.** The tiles keep the sidebar's order + (ADR-0102); a second way to order them would need a place to choose it. + +## Consequences + +- A column sort set in the list stays in this browser until it is turned back + to the tiles' order (a third click on the header); the tiles do not follow + it. +- The list scrolls sideways inside its frame where the screen is too narrow + for its columns. +- The tile's figures moved out of `StackTile.vue`: a change to them is made in + `stackFigures.ts` and shows in all three views. + +## Enforced by + +- `ui/src/lib/stackFigures.ts`, `ui/src/components/StackTile.vue`, + `ui/src/components/StackRow.vue`, `ui/src/views/HomeView.vue`, + `ui/src/stores/ui.ts` (`homeView`); tests in + `ui/src/views/HomeView.test.ts` and `ui/src/lib/stackFigures.test.ts`. diff --git a/docs/adr/0109-the-order-of-the-stacks-is-one-choice-for-the-sidebar-and-the-start-page.md b/docs/adr/0109-the-order-of-the-stacks-is-one-choice-for-the-sidebar-and-the-start-page.md new file mode 100644 index 00000000..af76771d --- /dev/null +++ b/docs/adr/0109-the-order-of-the-stacks-is-one-choice-for-the-sidebar-and-the-start-page.md @@ -0,0 +1,56 @@ +# ADR-0109: The order of the stacks is one choice for the sidebar and the start page + +- **Status:** Accepted (card in the pull request); built +- **Date:** 2026-11-17 +- **Deciders:** project owner +- **Related:** [ADR-0084](0084-the-sidebar-orders-stacks-by-name-or-last-opened.md) (the order menu), [ADR-0102](0102-the-stacks-list-orders-by-last-commit-hides-stacks-and-filters.md) (last edited first), [ADR-0086](0086-favourite-stacks-list-first.md) (favourites first), [ADR-0104](0104-the-start-page-shows-every-stack-as-a-tile.md) (its point 3: the tiles follow the sidebar's order, read when the page opens), [ADR-0108](0108-the-start-page-has-large-and-small-tiles-and-a-list.md) (the list), [ADR-0070](0070-a-review-card-comes-before-the-code-an-adr-records-what-was-built.md) + +## Context + +The start page took the sidebar's order when it opened (ADR-0104), but had no +way to change it: the choice had to be made in the sidebar's menu, and the +page showed it only after it was opened again. + +## Decision + +The owner approved the points in the conversation on **2026-11-17**, after +choosing that the order is one setting for both: + +| # | Category | Point | Beats | Reversing costs | +|---|---|---|---|---| +| 1 | concept | The start page gets the sidebar's order menu (by name, last opened first, last edited first; favourites always first) as a button in the filter row. | A menu of its own with other entries. | Low: UI code only. | +| 2 | concept | The order is one setting for the sidebar and the start page, and a choice in either shows in both at once. | Two separate orders. | Medium: the state lives in one shared module; separating them splits it again. | +| 3 | concept | The menu sets the order of the tiles and of the list; in the list a column chosen on its header overrides it until it is turned back. | The menu for the tiles only. | Low. | + +Decided on its own, not on the card: the menu is a component both pages use +(`StackOrderMenu.vue`), each drawing its button in its own look; last opened +and last edited stay snapshots that a page takes when it opens and when an +order is chosen (also the one already chosen), so nothing moves under the +pointer. + +As built: + +1. **The choice.** `useOrderChoice` (`ui/src/lib/stackOrder.ts`) holds the + order in one place, written to `devstack.sidebar.order` as before and read + from the browser when a page opens; every choice also counts up, which the + pages watch to take their snapshots anew. +2. **The ordering.** `useStackOrdering` takes the snapshots of one page and + sorts a list with them; the sidebar and the start page both use it, the + copy of that code in each is gone. +3. **The menu.** `ui/src/components/StackOrderMenu.vue` is the menu with its + outside-click and Escape handling, the button comes from the page + (`data-testid` `sidebar-order`, `overview-order`). + +## Consequences + +- The tiles of the start page follow a choice made while it is open; ADR-0104's + "when the page opens" no longer holds for the order (it holds for the + snapshots). +- A choice in one browser tab does not reach another tab until it is opened. + +## Enforced by + +- `ui/src/lib/stackOrder.ts` (`useOrderChoice`, `useStackOrdering`), + `ui/src/components/StackOrderMenu.vue`, `ui/src/components/Sidebar.vue`, + `ui/src/views/HomeView.vue`; tests in `ui/src/lib/stackOrder.test.ts`, + `ui/src/views/HomeView.test.ts` and `ui/src/components/Sidebar.test.ts`. diff --git a/docs/adr/README.md b/docs/adr/README.md index 406a0579..f4bbef48 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -189,3 +189,6 @@ stay. | [0104](0104-the-start-page-shows-every-stack-as-a-tile.md) | The start page shows every stack as a tile, with the hub's figures and the favourite programs | Accepted (card in the pull request); built | | [0105](0105-a-service-can-be-a-shortcut-card-on-the-overview.md) | A service can be a shortcut card on the overview, marked in the stack file | Accepted (card in the pull request); built | | [0106](0106-a-running-job-is-running-and-measured.md) | A running job is `running` and measured; it counts as done only when it completed | Accepted (card in the pull request); built | +| [0107](0107-the-start-page-has-a-search-and-a-state-filter.md) | The start page has a search by name or folder and a filter by state | Accepted (card in the pull request); built | +| [0108](0108-the-start-page-has-large-and-small-tiles-and-a-list.md) | The start page shows the stacks as large tiles, small tiles or a sortable list | Accepted (card in the pull request); built | +| [0109](0109-the-order-of-the-stacks-is-one-choice-for-the-sidebar-and-the-start-page.md) | The order of the stacks is one choice for the sidebar and the start page | Accepted (card in the pull request); built | diff --git a/ui/src/components/Sidebar.vue b/ui/src/components/Sidebar.vue index 266ca3f6..41483582 100644 --- a/ui/src/components/Sidebar.vue +++ b/ui/src/components/Sidebar.vue @@ -31,13 +31,9 @@ import { forgetHidden, forgetOpened, noteOpened, - openedTimes, - orderStacks, - savedOrder, - saveOrder, useFavourites, useHidden, - type StackOrder, + useStackOrdering, } from '@/lib/stackOrder'; import { useHub } from '@/stores/hub'; import { connectedTo, usePool } from '@/stores/pool'; @@ -47,6 +43,7 @@ import AddStackDialog from './AddStackDialog.vue'; import GuestTile from './GuestTile.vue'; import Icon from './icons/Icon.vue'; import ShiftHint from './ShiftHint.vue'; +import StackOrderMenu from './StackOrderMenu.vue'; const hub = useHub(); const stack = useStack(); @@ -112,19 +109,11 @@ const runningStacks = computed(() => hub.stacks.filter((s) => s.running && !hub. // in the list. Last opened is the snapshot taken when the page loaded or the // choice was made, so opening a stack does not move it under the pointer. // Favourites come first, and a star moves its stack at once. -const order = ref(savedOrder()); -const openedSnapshot = ref(openedTimes()); const favourites = useFavourites(); // Last edited is a snapshot too: a commit moves no row while the page is open. -// A stack seen later joins it with its time; the choice takes a fresh one. -const editedSnapshot = ref>({}); -function snapshotEdited(fresh: boolean) { - const next: Record = fresh ? {} : editedSnapshot.value; - for (const s of hub.stacks) if (s.last_commit != null && !(s.id in next)) next[s.id] = s.last_commit; - editedSnapshot.value = next; -} -watch(() => hub.stacks.map((s) => `${s.id}:${s.last_commit ?? ''}`).join(','), () => snapshotEdited(false), { immediate: true }); -const ordered = computed(() => orderStacks(hub.stacks, order.value, openedSnapshot.value, favourites.list(), editedSnapshot.value)); +// The order is one choice with the start page's (StackOrderMenu, lib/stackOrder.ts). +const ordering = useStackOrdering(() => hub.stacks); +const ordered = computed(() => ordering.sort(hub.stacks)); // Hide (this browser only): a hidden stack leaves the list and waits under // "Hidden"; it stays registered, which "Remove" does not. @@ -169,44 +158,6 @@ watch( }, { immediate: true }, ); -const orderMenu = ref(false); -const orderEl = ref(null); -const orderBtn = ref(null); -const orderPos = ref({ x: 0, y: 0 }); -function openOrderMenu() { - const r = orderBtn.value!.getBoundingClientRect(); - orderPos.value = { x: Math.max(4, r.right - 180), y: r.bottom + 2 }; - orderMenu.value = true; - void nextTick(() => orderEl.value?.querySelector('[aria-checked="true"]')?.focus()); -} -function closeOrderMenu() { - orderMenu.value = false; -} -function chooseOrder(o: StackOrder) { - order.value = o; - saveOrder(o); - openedSnapshot.value = openedTimes(); - snapshotEdited(true); - closeOrderMenu(); -} -function onOrderDown(e: PointerEvent) { - if (orderEl.value?.contains(e.target as Node) || orderBtn.value?.contains(e.target as Node)) return; - closeOrderMenu(); -} -function onOrderKey(e: KeyboardEvent) { - if (e.key === 'Escape') { - e.preventDefault(); - closeOrderMenu(); - orderBtn.value?.focus(); - } -} -watch(orderMenu, (open) => { - const add = open ? 'addEventListener' : 'removeEventListener'; - document[add]('pointerdown', onOrderDown as EventListener, true); - document[add]('keydown', onOrderKey as EventListener); - window[add]('blur', closeOrderMenu); -}); -onBeforeUnmount(closeOrderMenu); /** * The worktrees of every stack, kept across navigation: replaced when news @@ -517,20 +468,22 @@ function toggleFavourite(s: StackEntry) { > Stacks - + + + - -
+// The menu that orders the stacks (by name, last opened, last edited): the +// sidebar's and the start page's, one choice for both (lib/stackOrder.ts). +// The page draws the button that opens it, in its own look, from the slot. +import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'; +import { useOrderChoice, type StackOrder } from '@/lib/stackOrder'; +import Icon from './icons/Icon.vue'; + +const props = defineProps<{ menuTestId: string }>(); + +const choice = useOrderChoice(); +const options: { value: StackOrder; label: string; title: string }[] = [ + { value: 'name', label: 'By name', title: 'by name' }, + { value: 'opened', label: 'Last opened first', title: 'last opened first' }, + { value: 'edited', label: 'Last edited first', title: 'last edited first' }, +]; +/** For the button's tooltip. */ +const title = computed(() => `Order: ${options.find((o) => o.value === choice.order.value)?.title ?? 'by name'}`); + +const open = ref(false); +const menuEl = ref(null); +const button = ref(null); +const pos = ref({ x: 0, y: 0 }); +const setButton = (el: unknown) => { + button.value = (el as HTMLElement | null) ?? null; +}; + +function toggle() { + if (open.value) return close(); + const r = button.value!.getBoundingClientRect(); + pos.value = { x: Math.max(4, r.right - 180), y: r.bottom + 2 }; + open.value = true; + void nextTick(() => menuEl.value?.querySelector('[aria-checked="true"]')?.focus()); +} +function close() { + open.value = false; +} +function pick(o: StackOrder) { + choice.choose(o); + close(); +} +function onDown(e: PointerEvent) { + if (menuEl.value?.contains(e.target as Node) || button.value?.contains(e.target as Node)) return; + close(); +} +function onKey(e: KeyboardEvent) { + if (e.key === 'Escape') { + e.preventDefault(); + close(); + button.value?.focus(); + } +} +watch(open, (now) => { + const add = now ? 'addEventListener' : 'removeEventListener'; + document[add]('pointerdown', onDown as EventListener, true); + document[add]('keydown', onKey as EventListener); + window[add]('blur', close); +}); +onBeforeUnmount(close); + + + + + diff --git a/ui/src/components/StackRow.vue b/ui/src/components/StackRow.vue new file mode 100644 index 00000000..e8e26b34 --- /dev/null +++ b/ui/src/components/StackRow.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/ui/src/components/StackTile.vue b/ui/src/components/StackTile.vue index 83bfd291..dd014187 100644 --- a/ui/src/components/StackTile.vue +++ b/ui/src/components/StackTile.vue @@ -7,15 +7,17 @@ // above it. import { computed } from 'vue'; import type { StackEntry } from '@/api/types'; -import { ago, duration, useNow } from '@/lib/format'; +import { commitAge, duration, useNow } from '@/lib/format'; +import { stackFigures } from '@/lib/stackFigures'; import { stackPage } from '@/lib/stackRoutes'; -import type { Tone } from '@/lib/status'; import { useHub } from '@/stores/hub'; import Icon from './icons/Icon.vue'; import StatusPill from './StatusPill.vue'; import FavoriteOpeners from './FavoriteOpeners.vue'; -const props = defineProps<{ stack: StackEntry; favourite: boolean }>(); +// `compact`: the small tile, which leaves out how long it has been up and the +// ports shift, and tells only the first thing that needs attention. +const props = defineProps<{ stack: StackEntry; favourite: boolean; compact?: boolean }>(); const emit = defineEmits<{ toggleFavourite: [] }>(); const hub = useHub(); @@ -24,29 +26,11 @@ const now = useNow(); /** Most attention lines on a tile; the rest are counted. */ const SHOWN_ITEMS = 2; -const glance = computed(() => hub.glances[props.stack.id] ?? null); -const items = computed(() => hub.attention.filter((a) => a.stack === props.stack.id)); - -const look = computed((): { label: string; tone: Tone; busy: boolean } => { - const s = props.stack; - if (!hub.reachable) return { label: 'Unknown', tone: 'neutral', busy: false }; - // A start or stop this page asked for, before the hub's figures say it. - if (hub.stopping[s.id]) return { label: 'Stopping', tone: 'neutral', busy: true }; - if (hub.starting[s.id] && !s.running) return { label: 'Starting', tone: 'accent', busy: true }; - const state = glance.value?.state ?? (s.start_error ? 'attention' : s.running ? 'ok' : 'stopped'); - switch (state) { - case 'attention': - return { label: 'Needs attention', tone: items.value.some((i) => i.level === 'error') || s.start_error ? 'danger' : 'warn', busy: false }; - case 'starting': - return { label: 'Starting', tone: 'accent', busy: true }; - case 'stopping': - return { label: 'Stopping', tone: 'neutral', busy: true }; - case 'ok': - return { label: 'Running', tone: 'ok', busy: false }; - default: - return { label: 'Stopped', tone: 'neutral', busy: false }; - } -}); +const figures = computed(() => stackFigures(props.stack, hub)); +const look = computed(() => figures.value.look); +const items = computed(() => figures.value.items); +const services = computed(() => figures.value.services); +const lanes = computed(() => figures.value.lanes); /** The path's folder and its last part: a long path is cut in the folder, the repository's name stays. */ const parts = computed(() => { @@ -54,28 +38,15 @@ const parts = computed(() => { return m ? { dir: m[1], leaf: m[2] } : { dir: '', leaf: props.stack.repo }; }); -const services = computed(() => { - const g = glance.value; - if (!props.stack.running || !g || !g.total) return null; - return { ready: g.ready, total: g.total, share: g.ready / g.total }; -}); -const lanes = computed(() => (props.stack.running && glance.value ? glance.value.lanes : null)); -const upFor = computed(() => (props.stack.running && props.stack.daemon ? duration(now.value - props.stack.daemon.started) : null)); -const DAY = 86_400_000; -/** Within a day as `ago` says it; older in days, which fits a tile better than a date. */ -const committed = computed(() => { - const at = props.stack.last_commit ? props.stack.last_commit * 1000 : null; - if (!at) return null; - const days = Math.floor((now.value - at) / DAY); - return days >= 1 ? `${days} d ago` : ago(at, now.value); -}); +const upFor = computed(() => (figures.value.upSince !== null ? duration(now.value - figures.value.upSince) : null)); +const committed = computed(() => commitAge(figures.value.committedAt, now.value)); -const shownItems = computed(() => items.value.slice(0, SHOWN_ITEMS)); +const shownItems = computed(() => items.value.slice(0, props.compact ? 1 : SHOWN_ITEMS)); const moreItems = computed(() => items.value.length - shownItems.value.length);