mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(client): let users hide and reorder sidebar rows and groups
Add a Customize sidebar mode, opened from any section menu or Cmd+K, that hides rows and groups and reorders them by drag or keyboard, with reset and undo. The layout saves to a new sidebarLayout setting; a hidden Book Dock or Requests row returns while work is waiting. Also line up the Rows shown menu labels, which sat 3px apart. Closes #1434
This commit is contained in:
@@ -47,6 +47,8 @@ export interface UserSettings {
|
||||
/** Separate from dashboardConfig so legacy clients replacing it preserve shelf preferences. */
|
||||
dashboardShelfConfig?: import("./dashboard").DashboardShelfConfig;
|
||||
sidebarConfig?: import("./sidebar").SidebarConfig;
|
||||
/** Separate from sidebarConfig so an older client rewriting that key cannot wipe the layout. */
|
||||
sidebarLayout?: import("./sidebar").SidebarLayout | null;
|
||||
achievementPreferences?: {
|
||||
enabled?: boolean;
|
||||
};
|
||||
|
||||
@@ -36,6 +36,19 @@ export interface SidebarConfig {
|
||||
sections: Record<SidebarSectionId, SidebarSectionState>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Which sidebar rows and groups a user hid, and the order they arranged them in. Ids are nav entry
|
||||
* ids (`series`, `book-dock`) and group ids (`browse`, `libraries`); ids a client does not know are
|
||||
* ignored, and ids missing from an order fall back to their default position.
|
||||
*/
|
||||
export interface SidebarLayout {
|
||||
hidden: string[];
|
||||
/** Movable groups, top to bottom. The top group is pinned and never listed. */
|
||||
groupOrder: string[];
|
||||
/** Row order inside each nav group, keyed by group id. */
|
||||
rowOrder: Record<string, string[]>;
|
||||
}
|
||||
|
||||
/** Totals behind the sidebar Browse badges, served as one cached payload so the shell needs a single request. */
|
||||
export interface BrowseCounts {
|
||||
authors: number;
|
||||
|
||||
Reference in New Issue
Block a user