Implement the approved UX review across Fleet, Betas, Library, deployments, and Settings. Add reviewed promotion and reconciliation plans, atomic queued-removal cancellation, recoverable beta drafts and launch inputs, accessible controls, and mobile improvements. Validated with 473 tests, a clean typecheck, production build, and isolated desktop/mobile browser walkthroughs. Include the review and implementation coverage notes.
18 lines
819 B
TypeScript
18 lines
819 B
TypeScript
import { replaceState } from '$app/navigation';
|
|
import { page } from '$app/stores';
|
|
import { get } from 'svelte/store';
|
|
|
|
/** Keep library working views shareable and restore them on browser Back. */
|
|
export function saveLibraryContext(values: Record<string, string | number>, defaults: Record<string, string | number> = {}) {
|
|
const url = new URL(window.location.href);
|
|
for (const [key, value] of Object.entries(values)) {
|
|
if (value === '' || value === defaults[key]) url.searchParams.delete(key);
|
|
else url.searchParams.set(key, String(value));
|
|
}
|
|
if (url.href !== window.location.href) replaceState(url, get(page).state);
|
|
}
|
|
|
|
export function libraryLimit(params: URLSearchParams): number {
|
|
return Math.max(25, Math.min(10000, Number.parseInt(params.get('limit') ?? '25', 10) || 25));
|
|
}
|