lablup / lablup/backend.ai

Per-user preferences

Open
#2,349 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Let's implement persistent per-user preferences such as timezones, appearance settings, preferred language, etc.

There are several classes of preferences:

- Unmodifiable (fixed) user preference\* Settings applied to individual users, but set by superadmins only.
- e.g., Activation of functions like showing or hiding specific feature menus

- Modifiable user preference\* Settings applied to individual users which users may change by themselves.
- e.g., Localization (language, timezone) and generic appearance settings like dark-mode

- UI states\* More UI-specific fine-grained states
- e.g., Whether the sidebar is expanded or collapsed.

> [!NOTE]There is a working branch somewhere (?) worked by @inureyes several years ago.It implements the server-side storage of [the SettingsStore interface in the frontend.](https://github.com/lablup/backend.ai-webui/blob/0fd3b9cb3fc7a61bb92699a22908f97dafd17c94/src/components/backend-ai-settings-store.ts#L16)Let's inspect and revive it and implement the differentiated level of per-user preference and UI states using its _namespace_ concept.

> [!NOTE]This is a _different_ issue from #98. The current `/user-config` API is to CRUD per-user dotfiles which are auto-populated on the session container startup.

- [ ] Add a `config-user` json schema definition, placing it under `src/ai/backend/manager/models/schema`.\* Let's share the validation logic in the manager and webui using this json schema.
- In the manager, we could use pydantic to process the schema and validation.

- [ ] #2513\* Fill the default settings when migrating the database.

- [ ] Add a user configuration API set to the manager:\* `POST|GET /config/user/{user_id`} (write/read config)\* Q: Whether to allow updating only a specific key by accepting a partial json object?

- `GET /config/schema/user` (return the content of json schema)

- [ ] Update the user fixtures for development to include some default settings.
Currently we are storing per-user frontend settings in the browser's local storage, which is not traferrable to different browser sessions. Let's store this in the manager.

JIRA Issue: BA-112

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.