• Mohamed Aziz Mejri's avatar
    Initial ui theming (#2145) · 22f25ef5
    Mohamed Aziz Mejri 提交于
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Introduces initial UI theming with per-app theme selection and a default
    theme in settings. Theme rules are added to prompts so generated UIs
    follow the chosen design.
    
    - **New Features**
    - Theme picker in AuxiliaryActionsMenu with app-specific selection and
    visual check.
    - New hooks: useThemes and useAppTheme (React Query) with IPC get/set
    handlers.
    - Themes data and prompts added (includes “No Theme” and “Default
    Theme”).
    - Theme prompt appended to system and local-agent prompts; included in
    token counting.
    - Settings now support a default theme (selectedThemeId) applied to new
    apps.
    
    - **Migration**
      - Adds apps.theme_id (NULL means no theme).
    
    <sup>Written for commit f4ef96ccd02a3d9148bd4e570d2204c7b5a12c10.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Introduces initial theming with persistence and prompt influence.
    > 
    > - UI: Adds Themes submenu in `AuxiliaryActionsMenu` (supports "No
    Theme" and `default`, app-specific or global via settings)
    > - Data/IPC: New `apps.theme_id` column (nullable), hooks
    `useThemes`/`useAppTheme`, IPC handlers (`get-themes`, `set-app-theme`,
    `get-app-theme`) wired through `ipc_client`, `ipc_host`, and `preload`
    > - Settings: Adds `selectedThemeId` with default applied to newly
    created apps
    > - Prompting: Appends theme prompt (`getThemePrompt`) to
    system/local-agent prompts and token counting
    > - Integration: `ChatInput` passes `appId` to menu; `schema.ts` updated
    > - Tests: E2E verifies default and per-app theme persistence
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    ee9ba34aad48f8dc49013e01247cfdcff1b77fad. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    22f25ef5
theme_selection.spec.ts 2.7 KB