Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(inbox): make compact rows the default for new devices only (MUL-10006) (#11335)
Jiayuan Zhang576ff2d4eafa
diff --git a/apps/docs/components/demos/inbox-demo.tsx b/apps/docs/components/demos/inbox-demo.tsxindex fae9acacc3..cab999cedd 100644--- a/apps/docs/components/demos/inbox-demo.tsx+++ b/apps/docs/components/demos/inbox-demo.tsx@@ -704,35 +704,24 @@ export function InboxDemo() {aria-current={active ? "page" : undefined}onClick={() => setPhase("opened")}className={cn(- "flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left motion-safe:animate-in motion-safe:fade-in",+ "flex h-8 w-full items-center gap-2 rounded-md px-2 text-left motion-safe:animate-in motion-safe:fade-in",active ? "bg-accent" : "enabled:hover:bg-accent/50",)}>- <span className="mt-[3px] flex shrink-0">- <DemoStatus status={statusOf(notice.id)} />- </span>- <span className="flex min-w-0 flex-1 flex-col">- <span className="flex min-w-0 items-center gap-2 leading-5">- <span- className={cn(- "min-w-0 flex-1 truncate text-body",- rowUnread ? "font-medium text-foreground" : "text-muted-foreground",- )}- >- {notice.title}- </span>- <span className="shrink-0 text-caption text-faint-foreground tabular-nums">{notice.time}</span>- </span>- <span className="mt-0.5 flex min-w-0 items-center gap-2 text-caption leading-4 text-muted-foreground">- <span className="flex min-w-0 flex-1 items-center gap-1.5">- <RowAvatar name={notice.actor} agent={notice.agent} />- <span className="min-w-0 flex-1 truncate">- <span className="font-medium">{notice.actor}</span> {notice.detail}- </span>- </span>- {rowUnread && <span aria-hidden className="size-1.5 shrink-0 rounded-full bg-brand" />}- </span>+ <DemoStatus status={statusOf(notice.id)} />+ <span+ className={cn(+ "min-w-0 flex-1 truncate text-body",+ rowUnread ? "font-medium text-foreground" : "text-muted-foreground",+ )}+ >+ {notice.title}</span>+ <span className="shrink-0 text-caption text-faint-foreground tabular-nums">{notice.time}</span>+ <span+ aria-hidden+ className={cn("size-1.5 shrink-0 rounded-full", rowUnread ? "bg-brand" : "bg-transparent")}+ /></button></CoachMark></li>diff --git a/apps/docs/content/docs/inbox.fr.mdx b/apps/docs/content/docs/inbox.fr.mdxindex 88edd63dbb..a752404652 100644--- a/apps/docs/content/docs/inbox.fr.mdx+++ b/apps/docs/content/docs/inbox.fr.mdx@@ -12,7 +12,7 @@ La boîte de réception rassemble l'activité de travail qui vous concerne et siLa boîte de réception est une section du panneau **Travail**, sous les épingles et au-dessus des vues et des projets ; sans épingle, c'est la première section. Son en-tête porte trois onglets : **Boîte de réception**, **Reportés** et **Archivées**. Seul l'onglet ouvert affiche son nom ; les deux autres sont des icônes, nommées au survol. Sélectionner à nouveau l'onglet ouvert replie la section. Le nombre de non-lus s'affiche à côté de **Boîte de réception** et en badge sur **Travail** dans la barre d'applications ; un clic droit sur **Travail** propose **Tout marquer comme lu**.-L'onglet **Boîte de réception** affiche une ligne par tâche, de la plus récente à la plus ancienne, lues et non lues confondues. Une ligne montre le statut de la tâche, son titre et l'heure, et qui a fait quoi sur une deuxième ligne ; un point signale une ligne non lue. Activez **Lignes compactes** dans les réglages d'affichage pour garder chaque ligne sur une seule ligne. Survolez une ligne pour ouvrir une carte avec le titre complet, le commentaire, et **Ouvrir**, **Marquer comme lu** (ou **Marquer comme non lu** une fois lue), **Reporter** et **Archiver**. Un clic droit sur une ligne propose **Ouvrir dans un nouvel onglet**, **Marquer comme lu / non lu**, **Archiver** (ou **Désarchiver** dans l'onglet Archivées), **Se désabonner et archiver** et **Supprimer**.+L'onglet **Boîte de réception** affiche une ligne par tâche, de la plus récente à la plus ancienne, lues et non lues confondues. Une ligne montre le statut de la tâche, son titre et l'heure ; un point signale une ligne non lue. Désactivez **Lignes compactes** dans les réglages d'affichage pour ajouter qui a fait quoi sur une deuxième ligne. Survolez une ligne pour ouvrir une carte avec le titre complet, le commentaire, et **Ouvrir**, **Marquer comme lu** (ou **Marquer comme non lu** une fois lue), **Reporter** et **Archiver**. Un clic droit sur une ligne propose **Ouvrir dans un nouvel onglet**, **Marquer comme lu / non lu**, **Archiver** (ou **Désarchiver** dans l'onglet Archivées), **Se désabonner et archiver** et **Supprimer**.Sur téléphone, le panneau Travail se trouve dans le tiroir. Sa section Boîte de réception se termine par **Toutes les notifications**, qui ouvre la page Boîte de réception avec sa propre liste, les mêmes trois onglets et ses filtres.@@ -153,7 +153,7 @@ Une notification ultérieure sur la tâche revient dans la boîte de réception.Le bouton de réglages dans l'en-tête de la section Boîte de réception ouvre ses réglages d'affichage, enregistrés sur cet appareil :- **Lignes affichées** : 5, 10 ou 20 ; une ligne « Afficher N de plus » donne accès au reste.-- **Lignes compactes** : une seule ligne par notification, sans qui a fait quoi. Désactivé par défaut.+- **Lignes compactes** : une seule ligne par notification, activé par défaut ; désactivé, chaque ligne ajoute qui a fait quoi sur une deuxième ligne.- **Nombre de non lus** : le nombre à côté du titre de la section.- **Badge de non lus sur Travail** : le badge sur Travail dans la barre d'applications.diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdxindex 1b501f21b3..08af4c3bae 100644--- a/apps/docs/content/docs/inbox.ja.mdx+++ b/apps/docs/content/docs/inbox.ja.mdx@@ -12,7 +12,7 @@ import { InboxDemo } from "@/components/demos/inbox-demo";インボックスは **作業** パネルのセクションで、ピン留め済みの下、ビューとプロジェクトの上にあります。ピン留めがないときは最初のセクションになります。見出しには **インボックス**、**スヌーズ中**、**アーカイブ済み** の 3 つのタブがあります。名前が表示されるのは開いているタブだけで、ほかの 2 つはアイコンになり、ポインタを合わせると名前が出ます。開いているタブをもう一度選ぶとセクションを折りたためます。未読数は **インボックス** の横と、アプリレールの **作業** のバッジに表示されます。**作業** を右クリックすると **すべて既読にする** を使えます。-**インボックス** タブにはタスクごとに 1 行ずつ、新しい順に、既読・未読を問わず並びます。行にはタスクのステータス、タイトルと時刻、2 行目に誰が何をしたかが表示され、未読の行にはドットが付きます。表示設定で **コンパクト表示** をオンにすると、各行が 1 行になります。行にカーソルを合わせると、タイトル全文とコメントを表示するカードが開き、**開く**、**既読にする**(既読のときは **未読にする**)、**スヌーズ**、**アーカイブ** を使えます。行を右クリックすると、**新しいタブで開く**、**既読にする / 未読にする**、**アーカイブ**(アーカイブ済みタブでは **アーカイブ解除**)、**購読解除してアーカイブ**、**削除** を選べます。+**インボックス** タブにはタスクごとに 1 行ずつ、新しい順に、既読・未読を問わず並びます。行にはタスクのステータス、タイトルと時刻が表示され、未読の行にはドットが付きます。表示設定で **コンパクト表示** をオフにすると、誰が何をしたかが 2 行目に加わります。行にカーソルを合わせると、タイトル全文とコメントを表示するカードが開き、**開く**、**既読にする**(既読のときは **未読にする**)、**スヌーズ**、**アーカイブ** を使えます。行を右クリックすると、**新しいタブで開く**、**既読にする / 未読にする**、**アーカイブ**(アーカイブ済みタブでは **アーカイブ解除**)、**購読解除してアーカイブ**、**削除** を選べます。スマートフォンでは、作業パネルはドロワーの中にあります。そのインボックスセクションの末尾にある **すべての通知** から、独自のリスト、同じ 3 つのタブ、フィルターを持つインボックスページを開けます。@@ -153,7 +153,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1wインボックスセクションの見出しにある設定ボタンで表示設定を開けます。この設定はこのデバイスにだけ保存されます。- **表示件数**:5、10、20 件。残りは「さらに N 件を表示」の行にまとまります。-- **コンパクト表示**:1 件を 1 行で表示し、誰が何をしたかは表示しません。既定ではオフです。+- **コンパクト表示**:1 件を 1 行で表示します。既定でオンで、オフにすると誰が何をしたかが 2 行目に加わります。- **未読数**:セクション名の横の数字です。- **「作業」に未読バッジを表示**:アプリレールの作業のバッジです。diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdxindex 239ae7f3cd..abda03988d 100644--- a/apps/docs/content/docs/inbox.ko.mdx+++ b/apps/docs/content/docs/inbox.ko.mdx@@ -12,7 +12,7 @@ import { InboxDemo } from "@/components/demos/inbox-demo";인박스는 **작업** 패널의 섹션으로, 고정됨 아래, 뷰와 프로젝트 위에 있습니다. 고정한 항목이 없으면 첫 번째 섹션이 됩니다. 섹션 제목에는 **인박스**, **미뤄둔 항목**, **보관됨** 세 개의 탭이 있습니다. 열린 탭만 이름이 보이고 나머지 두 탭은 아이콘으로 표시되며, 마우스를 올리면 이름이 나타납니다. 열린 탭을 다시 선택하면 섹션이 접힙니다. 읽지 않은 수는 **인박스** 옆과 앱 레일의 **작업** 배지에 표시됩니다. **작업**을 오른쪽 클릭하면 **모두 읽음으로 표시**를 쓸 수 있습니다.-**인박스** 탭에는 태스크마다 한 행씩, 최신순으로, 읽음 여부와 관계없이 표시됩니다. 행에는 태스크 상태, 제목과 시간, 그리고 두 번째 줄에 누가 무엇을 했는지가 보이고, 읽지 않은 행에는 점이 붙습니다. 표시 설정에서 **간결하게 표시**를 켜면 각 행이 한 줄로 줄어듭니다. 행 위에 마우스를 올리면 전체 제목과 댓글이 담긴 카드가 열리고, **열기**, **읽음으로 표시**(이미 읽은 경우 **읽지 않음으로 표시**), **다시 알림**, **보관**을 쓸 수 있습니다. 행을 오른쪽 클릭하면 **새 탭에서 열기**, **읽음으로 표시 / 읽지 않음으로 표시**, **보관**(보관됨 탭에서는 **보관 해제**), **구독 해제 후 보관**, **삭제**를 선택할 수 있습니다.+**인박스** 탭에는 태스크마다 한 행씩, 최신순으로, 읽음 여부와 관계없이 표시됩니다. 행에는 태스크 상태, 제목과 시간이 보이고, 읽지 않은 행에는 점이 붙습니다. 표시 설정에서 **간결하게 표시**를 끄면 누가 무엇을 했는지가 두 번째 줄에 더해집니다. 행 위에 마우스를 올리면 전체 제목과 댓글이 담긴 카드가 열리고, **열기**, **읽음으로 표시**(이미 읽은 경우 **읽지 않음으로 표시**), **다시 알림**, **보관**을 쓸 수 있습니다. 행을 오른쪽 클릭하면 **새 탭에서 열기**, **읽음으로 표시 / 읽지 않음으로 표시**, **보관**(보관됨 탭에서는 **보관 해제**), **구독 해제 후 보관**, **삭제**를 선택할 수 있습니다.휴대폰에서는 작업 패널이 서랍 안에 있습니다. 그 인박스 섹션 맨 아래의 **모든 알림**을 누르면 자체 목록, 같은 세 개의 탭, 필터가 있는 인박스 페이지가 열립니다.@@ -153,7 +153,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339, 30m, 3h, 1d, 1w; uns인박스 섹션 제목 줄의 설정 버튼을 누르면 표시 설정이 열립니다. 이 설정은 현재 기기에만 저장됩니다.- **표시 개수**: 5, 10, 20개. 나머지는 "N개 더 보기" 행에 모입니다.-- **간결하게 표시**: 한 항목을 한 줄로 표시하고, 누가 무엇을 했는지는 표시하지 않습니다. 기본으로 꺼져 있습니다.+- **간결하게 표시**: 한 항목을 한 줄로 표시합니다. 기본으로 켜져 있으며, 끄면 누가 무엇을 했는지가 두 번째 줄에 더해집니다.- **읽지 않은 수**: 섹션 제목 옆의 숫자입니다.- **'작업'에 읽지 않음 배지 표시**: 앱 레일의 작업에 붙는 배지입니다.diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdxindex 2e05a07825..1a89ae6741 100644--- a/apps/docs/content/docs/inbox.mdx+++ b/apps/docs/content/docs/inbox.mdx@@ -12,7 +12,7 @@ The inbox collects the work activity that concerns you and flags where somethingThe inbox is a section of the **Work** panel, below Pinned and above Views and Projects; with nothing pinned, it is the first section. Its header holds three tabs: **Inbox**, **Snoozed** and **Archived**. Only the open tab shows its name; the other two are icons, named when you hover them. Select the open tab again to collapse the section. The unread count shows next to **Inbox** and as a badge on **Work** in the app rail; right-click **Work** for **Mark all as read**.-The **Inbox** tab lists one row per issue, newest first, read and unread alike. A row shows the issue's status, its title and time, and who did what on a second line; a dot marks it unread. Turn on **Compact rows** in the display settings to keep each row to one line. Hover a row for a card with the full title, the comment, and **Open**, **Mark as read** (or **Mark as unread** when read), **Snooze**, and **Archive**. Right-click a row for **Open in new tab**, **Mark as read** / **Mark as unread**, **Archive** (or **Unarchive** on the Archived tab), **Unsubscribe & archive**, and **Delete**.+The **Inbox** tab lists one row per issue, newest first, read and unread alike. A row shows the issue's status, its title and time; a dot marks it unread. Turn off **Compact rows** in the display settings to add who did what on a second line. Hover a row for a card with the full title, the comment, and **Open**, **Mark as read** (or **Mark as unread** when read), **Snooze**, and **Archive**. Right-click a row for **Open in new tab**, **Mark as read** / **Mark as unread**, **Archive** (or **Unarchive** on the Archived tab), **Unsubscribe & archive**, and **Delete**.On a phone, the Work panel sits in the drawer. Its Inbox section ends with **All notifications**, which opens the Inbox page with its own list, the same three tabs, and filters.@@ -153,7 +153,7 @@ A later notification on the issue lands in the inbox again.The sliders button in the Inbox section header opens its display settings, which are saved on this device:- **Rows shown**: 5, 10, or 20; a **Show more** row lists the rest.-- **Compact rows**: one line per row, without who did what. Off by default.+- **Compact rows**: one line per row, on by default; turned off, rows add who did what on a second line.- **Unread count**: the number next to the section title.- **Unread badge on Work**: the badge on Work in the app rail.diff --git a/apps/docs/content/docs/inbox.zh-Hant.mdx b/apps/docs/content/docs/inbox.zh-Hant.mdxindex 1dd89d855f..4d527c27a6 100644--- a/apps/docs/content/docs/inbox.zh-Hant.mdx+++ b/apps/docs/content/docs/inbox.zh-Hant.mdx@@ -12,7 +12,7 @@ import { InboxDemo } from "@/components/demos/inbox-demo";收件箱是**工作**面板裡的一個分區,排在固定之後、檢視和專案之前;沒有固定項時,它就是第一個分區。分區標題列有三個分頁:**收件箱**、**已延後**和**已歸檔**。只有目前的分頁顯示名稱,另外兩個顯示為圖示,懸停可看到名稱。再次點選目前的分頁可以收合這個分區。未讀數顯示在**收件箱**旁,也會以角標顯示在應用側欄的**工作**上;右鍵點選**工作**可以**全部標為已讀**。-**收件箱**分頁每個任務佔一列,最新的在前,已讀和未讀都在。每列顯示任務狀態、標題和時間,第二行顯示誰做了什麼;未讀的列帶一個圓點。在顯示設定裡打開**緊湊顯示**,每列只保留一行。滑鼠懸停在某列上會彈出卡片,顯示完整標題和評論內容,並提供**開啟**、**標為已讀**(已讀時提供**標為未讀**)、**延後**和**歸檔**。右鍵點擊某列可**在新分頁開啟**、**標為已讀 / 未讀**、**歸檔**(已歸檔分頁下為**取消歸檔**)、**取消訂閱並歸檔**,或永久**刪除**通知。+**收件箱**分頁每個任務佔一列,最新的在前,已讀和未讀都在。每列顯示任務狀態、標題和時間;未讀的列帶一個圓點。在顯示設定裡關掉**緊湊顯示**,每列會多出第二行,顯示誰做了什麼。滑鼠懸停在某列上會彈出卡片,顯示完整標題和評論內容,並提供**開啟**、**標為已讀**(已讀時提供**標為未讀**)、**延後**和**歸檔**。右鍵點擊某列可**在新分頁開啟**、**標為已讀 / 未讀**、**歸檔**(已歸檔分頁下為**取消歸檔**)、**取消訂閱並歸檔**,或永久**刪除**通知。在手機上,工作面板收在抽屜裡。其中的收件箱分區末尾有**全部通知**,點開是收件箱頁面,帶自己的列表、同樣的三個分頁和篩選。@@ -153,7 +153,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w收件箱分區標題列的設定按鈕會開啟它的顯示設定,只儲存在目前裝置上:- **顯示筆數**:5、10 或 20 筆;其餘的收在"再顯示 N 項"裡。-- **緊湊顯示**:每列只佔一行高度,不顯示誰做了什麼。預設關閉。+- **緊湊顯示**:每列只佔一行高度,預設開啟;關掉後每列多出第二行,顯示誰做了什麼。- **未讀數量**:分區標題旁的數字。- **在"工作"上顯示未讀數**:應用側欄裡工作上的角標。diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdxindex 291430a035..0830275b1e 100644--- a/apps/docs/content/docs/inbox.zh.mdx+++ b/apps/docs/content/docs/inbox.zh.mdx@@ -12,7 +12,7 @@ import { InboxDemo } from "@/components/demos/inbox-demo";收件箱是**工作**面板里的一个分区,排在固定之后、视图和项目之前;没有固定项时,它就是第一个分区。分区标题栏有三个标签:**收件箱**、**已延后**和**已归档**。只有当前标签显示名称,另外两个显示为图标,悬停可看到名称。再次点击当前标签可以折叠这个分区。未读数显示在**收件箱**旁,也会以角标显示在应用侧栏的**工作**上;右键点击**工作**可以**全部标为已读**。-**收件箱**标签每个任务占一行,最新的在前,已读和未读都在。每行显示任务状态、标题和时间,第二行显示谁做了什么;未读的行带一个圆点。在显示设置里打开**紧凑显示**,每行只保留一行。鼠标悬停在某行上会弹出卡片,显示完整标题和评论内容,并提供**打开**、**标为已读**(已读时提供**标为未读**)、**延后**和**归档**。右键点击某行可**在新标签页打开**、**标为已读 / 未读**、**归档**(已归档标签下为**取消归档**)、**取消订阅并归档**,或永久**删除**通知。+**收件箱**标签每个任务占一行,最新的在前,已读和未读都在。每行显示任务状态、标题和时间;未读的行带一个圆点。在显示设置里关掉**紧凑显示**,每行会多出第二行,显示谁做了什么。鼠标悬停在某行上会弹出卡片,显示完整标题和评论内容,并提供**打开**、**标为已读**(已读时提供**标为未读**)、**延后**和**归档**。右键点击某行可**在新标签页打开**、**标为已读 / 未读**、**归档**(已归档标签下为**取消归档**)、**取消订阅并归档**,或永久**删除**通知。在手机上,工作面板收在抽屉里。其中的收件箱分区末尾有**全部通知**,点开是收件箱页面,带自己的列表、同样的三个标签和筛选。@@ -153,7 +153,7 @@ multica inbox snooze <id>... --until tomorrow # RFC 3339、30m、3h、1d、1w收件箱分区标题栏的设置按钮会打开它的显示设置,只保存在当前设备上:- **显示条数**:5、10 或 20 条;其余的收在"再显示 N 项"里。-- **紧凑显示**:每行只占一行高度,不显示谁做了什么。默认关闭。+- **紧凑显示**:每行只占一行高度,默认开启;关掉后每行多出第二行,显示谁做了什么。- **未读数量**:分区标题旁的数字。- **在"工作"上显示未读数**:应用侧栏里工作上的角标。diff --git a/packages/core/issues/stores/sidebar-tree-store.test.ts b/packages/core/issues/stores/sidebar-tree-store.test.tsindex a84dd6563f..3b6fde281d 100644--- a/packages/core/issues/stores/sidebar-tree-store.test.ts+++ b/packages/core/issues/stores/sidebar-tree-store.test.ts@@ -65,39 +65,60 @@ describe("useSidebarTreeStore", () => {expect(state.needsAttentionCollapsed).toBe(false);});- it("keeps Inbox rows off compact by default, and undoes the one-time compact switch", async () => {- expect(DEFAULT_SIDEBAR_INBOX_SETTINGS.compact).toBe(false);+ describe("compact Inbox rows", () => {+ async function open(slug: string, stored?: { state: unknown; version: number }) {+ if (stored) localStorage.setItem(`multica_sidebar_tree:${slug}`, JSON.stringify(stored));+ setCurrentWorkspace(slug, `ws-${slug}`);+ await Promise.resolve();+ return useSidebarTreeStore.getState().inboxSettings;+ }- // Version 1 forced compact on; that value goes back to off.- localStorage.setItem("multica_sidebar_tree:forced", JSON.stringify({- state: { inboxSettings: { limit: 10, showCount: false, railBadge: true, compact: true } },- version: 1,- }));- setCurrentWorkspace("forced", "ws-forced");- await Promise.resolve();- expect(useSidebarTreeStore.getState().inboxSettings).toEqual({- limit: 10,- showCount: false,- railBadge: true,- compact: false,+ it("are on by default where nothing is stored yet", async () => {+ expect(DEFAULT_SIDEBAR_INBOX_SETTINGS.compact).toBe(true);+ expect((await open("fresh")).compact).toBe(true);});- // A copy that never ran version 1 keeps the user's own choice.- localStorage.setItem("multica_sidebar_tree:chosen", JSON.stringify({- state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: true } },- version: 0,- }));- setCurrentWorkspace("chosen", "ws-chosen");- await Promise.resolve();- expect(useSidebarTreeStore.getState().inboxSettings.compact).toBe(true);+ it("stay off for a copy stored while two-line rows were the default", async () => {+ const inboxSettings = await open("existing", {+ state: { inboxSettings: { limit: 10, showCount: false, railBadge: true, compact: false } },+ version: 2,+ });+ expect(inboxSettings).toEqual({ limit: 10, showCount: false, railBadge: true, compact: false });+ });- // A choice made after this version stays.- localStorage.setItem("multica_sidebar_tree:current", JSON.stringify({- state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: true } },- version: 2,- }));- setCurrentWorkspace("current", "ws-current");- await Promise.resolve();- expect(useSidebarTreeStore.getState().inboxSettings.compact).toBe(true);+ it("stay off for a copy stored before the setting existed", async () => {+ const inboxSettings = await open("legacy", { state: { expanded: ["project:p1"] }, version: 0 });+ expect(inboxSettings).toEqual({ ...DEFAULT_SIDEBAR_INBOX_SETTINGS, compact: false });+ });++ it("go back off once for a copy that version 1 forced on", async () => {+ const inboxSettings = await open("forced", {+ state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: true } },+ version: 1,+ });+ expect(inboxSettings.compact).toBe(false);+ });++ it("keep a value the user picked", async () => {+ expect((await open("chosen-v0", {+ state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: true } },+ version: 0,+ })).compact).toBe(true);+ expect((await open("chosen-v2", {+ state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: true } },+ version: 2,+ })).compact).toBe(true);+ expect((await open("chosen-v3", {+ state: { inboxSettings: { limit: 5, showCount: true, railBadge: true, compact: false } },+ version: 3,+ })).compact).toBe(false);+ });++ it("save the kept value with the copy, so a later default leaves it alone", async () => {+ await open("saved", { state: { expanded: [] }, version: 0 });+ const saved = JSON.parse(localStorage.getItem("multica_sidebar_tree:saved")!);+ expect(saved.version).toBe(3);+ expect(saved.state.inboxSettings.compact).toBe(false);+ });});});diff --git a/packages/core/issues/stores/sidebar-tree-store.ts b/packages/core/issues/stores/sidebar-tree-store.tsindex 9d45c9ff49..fb4a91c829 100644--- a/packages/core/issues/stores/sidebar-tree-store.ts+++ b/packages/core/issues/stores/sidebar-tree-store.ts@@ -68,7 +68,7 @@ export const DEFAULT_SIDEBAR_INBOX_SETTINGS: SidebarInboxSettings = {limit: 5,showCount: true,railBadge: true,- compact: false,+ compact: true,};export interface SidebarLocateRequest {@@ -182,11 +182,14 @@ export const useSidebarTreeStore = create<SidebarTreeState>()(// 2: compact is off by default again. A version-1 copy holds that forced// value rather than a choice, so it goes back to off once; an older copy// never ran version 1 and keeps what the user picked.- version: 2,+ // 3: compact is on by default, for devices with nothing stored yet. A+ // stored copy belongs to someone who already used the Inbox section, so+ // it keeps its value, and one without a value keeps the two-line rows.+ version: 3,migrate: (persisted, version) => {const p = (persisted ?? {}) as Partial<PersistedSidebarTree>;- if (version === 1 && p.inboxSettings) return { ...p, inboxSettings: { ...p.inboxSettings, compact: false } };- return p;+ const compact = version === 1 ? false : (p.inboxSettings?.compact ?? false);+ return { ...p, inboxSettings: { ...DEFAULT_SIDEBAR_INBOX_SETTINGS, ...p.inboxSettings, compact } };},partialize: (state): PersistedSidebarTree => ({expanded: state.expanded,