mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
feat(ui): add toggle button for inbox parent-child nesting
Adds a ListTree icon button in the inbox top bar to toggle nesting on/off. Preference is persisted in localStorage. When disabled, all issues display as a flat list without grouping. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
097f30b138
commit
d3e66c789e
2 changed files with 48 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ export const DISMISSED_KEY = "paperclip:inbox:dismissed";
|
|||
export const READ_ITEMS_KEY = "paperclip:inbox:read-items";
|
||||
export const INBOX_LAST_TAB_KEY = "paperclip:inbox:last-tab";
|
||||
export const INBOX_ISSUE_COLUMNS_KEY = "paperclip:inbox:issue-columns";
|
||||
export const INBOX_NESTING_KEY = "paperclip:inbox:nesting";
|
||||
export type InboxTab = "mine" | "recent" | "unread" | "all";
|
||||
export type InboxApprovalFilter = "all" | "actionable" | "resolved";
|
||||
export const inboxIssueColumns = ["status", "id", "assignee", "project", "workspace", "parent", "labels", "updated"] as const;
|
||||
|
|
@ -151,6 +152,23 @@ export function resolveIssueWorkspaceName(
|
|||
return null;
|
||||
}
|
||||
|
||||
export function loadInboxNesting(): boolean {
|
||||
try {
|
||||
const raw = localStorage.getItem(INBOX_NESTING_KEY);
|
||||
return raw !== "false";
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export function saveInboxNesting(enabled: boolean) {
|
||||
try {
|
||||
localStorage.setItem(INBOX_NESTING_KEY, String(enabled));
|
||||
} catch {
|
||||
// Ignore localStorage failures.
|
||||
}
|
||||
}
|
||||
|
||||
export function loadLastInboxTab(): InboxTab {
|
||||
try {
|
||||
const raw = localStorage.getItem(INBOX_LAST_TAB_KEY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue