chore: follow the general comments style
This commit is contained in:
@@ -22,6 +22,9 @@ import { responsiveManager } from '$shared/lib';
|
||||
export type LayoutMode = 'list' | 'grid';
|
||||
|
||||
interface LayoutConfig {
|
||||
/**
|
||||
* Active display mode (list | grid)
|
||||
*/
|
||||
mode: LayoutMode;
|
||||
}
|
||||
|
||||
@@ -40,9 +43,13 @@ const DEFAULT_CONFIG: LayoutConfig = {
|
||||
* calculation. Persists user preference to localStorage.
|
||||
*/
|
||||
class LayoutManager {
|
||||
/** Current layout mode */
|
||||
/**
|
||||
* Reactive layout mode state
|
||||
*/
|
||||
#mode = $state<LayoutMode>(DEFAULT_CONFIG.mode);
|
||||
/** Persistent storage for layout preference */
|
||||
/**
|
||||
* Persistence layer for saving layout between sessions
|
||||
*/
|
||||
#store = createPersistentStore<LayoutConfig>(STORAGE_KEY, DEFAULT_CONFIG);
|
||||
|
||||
constructor() {
|
||||
@@ -53,7 +60,9 @@ class LayoutManager {
|
||||
}
|
||||
}
|
||||
|
||||
/** Current layout mode ('list' or 'grid') */
|
||||
/**
|
||||
* Current active layout mode
|
||||
*/
|
||||
get mode(): LayoutMode {
|
||||
return this.#mode;
|
||||
}
|
||||
@@ -66,12 +75,16 @@ class LayoutManager {
|
||||
return responsiveManager.isMobile || responsiveManager.isTabletPortrait ? SM_GAP_PX : MD_GAP_PX;
|
||||
}
|
||||
|
||||
/** Whether currently in list mode */
|
||||
/**
|
||||
* True if currently showing a single-column list
|
||||
*/
|
||||
get isListMode(): boolean {
|
||||
return this.#mode === 'list';
|
||||
}
|
||||
|
||||
/** Whether currently in grid mode */
|
||||
/**
|
||||
* True if currently showing a multi-column grid
|
||||
*/
|
||||
get isGridMode(): boolean {
|
||||
return this.#mode === 'grid';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/** @vitest-environment jsdom */
|
||||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
|
||||
import {
|
||||
afterEach,
|
||||
|
||||
Reference in New Issue
Block a user