9c16d337a2
* feat(web): add app status bar * feat(web): add app status bar visibility toggle * feat(web): persist status bar item order * fix(web): refine app status bar behavior * fix(web): polish app status bar presentation * test(web): split plugin slot coverage groups * fix(web): address status surface review feedback * fix(web): stabilize status bar overlay tests
31 lines
854 B
TypeScript
31 lines
854 B
TypeScript
import type { StateCreator } from "zustand";
|
|
import type { FeaturesSlice, FeaturesSliceState } from "./types";
|
|
|
|
export const defaultFeaturesState: FeaturesSliceState = {
|
|
// All flags default to false. Production releases ship every flag off
|
|
// until the deployment opts in via env var (e.g. KANDEV_FEATURES_OFFICE).
|
|
// The SSR layer overwrites this with whatever the backend reports.
|
|
features: {
|
|
office: false,
|
|
plugins: false,
|
|
appStatusBar: false,
|
|
},
|
|
};
|
|
|
|
type ImmerSet = Parameters<
|
|
StateCreator<FeaturesSlice, [["zustand/immer", never]], [], FeaturesSlice>
|
|
>[0];
|
|
|
|
export const createFeaturesSlice: StateCreator<
|
|
FeaturesSlice,
|
|
[["zustand/immer", never]],
|
|
[],
|
|
FeaturesSlice
|
|
> = (set: ImmerSet) => ({
|
|
...defaultFeaturesState,
|
|
setFeatures: (features) =>
|
|
set((draft) => {
|
|
draft.features = features;
|
|
}),
|
|
});
|