Skip to content

fix: color mode and memories#7642

Merged
yuhongsun96 merged 1 commit intomainfrom
fix-bugs
Jan 21, 2026
Merged

fix: color mode and memories#7642
yuhongsun96 merged 1 commit intomainfrom
fix-bugs

Conversation

@yuhongsun96
Copy link
Copy Markdown
Contributor

@yuhongsun96 yuhongsun96 commented Jan 21, 2026

Description

Color mode auto was wrong
Including memories logic was missing

How Has This Been Tested?

Works now

Additional Options

  • [Optional] Override Linear Check

Summary by cubic

Fixes the “System” color mode preview to match the OS theme and stops fetching memories when the user has memories disabled.

  • Bug Fixes
    • Frontend: use systemTheme for the System option’s swatch and description in SettingsPage.
    • Backend: get_memories returns an empty list when user.use_memories is False.

Written for commit 2b30da7. Summary will update on new commits.

@yuhongsun96 yuhongsun96 requested a review from a team as a code owner January 21, 2026 21:25
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Jan 21, 2026

Greptile Summary

This PR fixes two small but important bugs:

Backend (memory.py):

  • Added a check for the user.use_memories flag before returning user memories
  • Previously, memories were returned regardless of the user's preference setting, which could expose personal information even when the feature was disabled

Frontend (SettingsPage.tsx):

  • Fixed the "Auto" color mode display to show the actual system theme preference
  • Changed from using resolvedTheme (which always matches current display) to systemTheme (which shows OS preference)
  • This ensures the color swatch correctly indicates what theme the system is set to when "Auto" is selected

Both changes are straightforward bug fixes that align behavior with user expectations.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Both changes are small, focused bug fixes with clear intent. The memory check adds proper authorization logic that should have been there, and the theme change fixes a UI display issue. No complex logic, no edge cases, and the changes align with the existing codebase patterns.
  • No files require special attention

Important Files Changed

Filename Overview
backend/onyx/db/memory.py Added check to respect use_memories flag before returning user memories
web/src/refresh-pages/SettingsPage.tsx Fixed color mode auto display to use systemTheme instead of resolvedTheme

Sequence Diagram

sequenceDiagram
    participant User
    participant SettingsPage
    participant useTheme
    participant get_memories
    participant Database

    Note over User,Database: Frontend: Color Mode Fix
    User->>SettingsPage: Select "Auto" theme
    SettingsPage->>useTheme: Request systemTheme
    useTheme-->>SettingsPage: Return OS theme preference (light/dark)
    SettingsPage->>User: Display ColorSwatch with system theme

    Note over User,Database: Backend: Memories Authorization Fix
    User->>get_memories: Request user memories
    get_memories->>Database: Check user.use_memories flag
    alt use_memories is False
        get_memories-->>User: Return empty array []
    else use_memories is True
        get_memories->>Database: Fetch user info + memories
        Database-->>get_memories: Return memory data
        get_memories-->>User: Return memories list
    end
Loading

@yuhongsun96 yuhongsun96 merged commit 683c3f7 into main Jan 21, 2026
34 checks passed
@yuhongsun96 yuhongsun96 deleted the fix-bugs branch January 21, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants