Skip to content

Conversation

@paullinator
Copy link
Member

@paullinator paullinator commented Dec 4, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Adds a theme parser and updates the theme server to read/write a palette+theme JSON format using a configurable override file path.

  • Theme tooling:
    • New scripts/themeParser.ts: Parses edgeDark.ts to extract palette, identifies runtime props, converts values to palette refs, merges runtime theme into { palette, theme }, and resolves palette refs for serving.
    • Updated scripts/themeServer.ts:
      • Uses mergeTheme and parseOverrideTheme to handle the new { palette, theme } format.
      • Reads/writes override theme at THEME_SERVER.overrideThemeFile; logs JSON and serves resolved flat theme via GET /theme.
      • Adds THEME_SOURCE_PATH and minor typing/paths cleanup.
  • Config:
    • src/envConfig.ts: Adds THEME_SERVER.overrideThemeFile option with defaults.
  • Lint:
    • eslint.config.mjs: Removes scripts/themeServer.ts from the warnings exceptions list.

Written by Cursor Bugbot for commit 773a9b5. This will update automatically on new commits. Configure here.


host: 'localhost',
port: '8008',
overrideThemeFile: '/Users/username/Documents/overrideTheme.json'
}
Copy link

Choose a reason for hiding this comment

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

Bug: Hardcoded developer path in default configuration

The overrideThemeFile default value contains a hardcoded developer-specific path /Users/username/Documents/overrideTheme.json. This path won't exist on other developers' machines or in CI/production environments, causing file read/write operations in themeServer.ts to fail with file-not-found errors. The default appears to be placeholder/example text rather than a valid default path.

Fix in Cursor Fix in Web


const envConfig = asEnvConfig(envJSON)
const { overrideThemeFile } = envConfig.THEME_SERVER

Copy link

Choose a reason for hiding this comment

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

Bug: Config setting lost when env.json is rewritten

The overrideThemeFile configuration property is extracted from envConfig.THEME_SERVER at line 33, but when env.json is written back at lines 53-57, envJSON.THEME_SERVER is overwritten with only host and port. This causes any user-configured overrideThemeFile value in env.json to be permanently lost after the first server run. Subsequent server starts will fall back to the default value instead of the user's configured path.

Fix in Cursor Fix in Web

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

The whole concept of the themeParser is awful! This could only exist in an age of AI where we can produce terrible ideas faster than we can understand or maintain them. But... you probably knew that already. Actually, this is fine as long as we finish the light theme project before anybody makes any major refactors to the edgeDark.ts file. The theme server will get the job done for now, and by the time this fragile approach inevitably breaks, we will hopefully be past the point where we even care. So yes, this PR is approved, because this isn't a part of the "real" app and it's better to have working tools than not.

If we were to do this "properly", some ideas would be to either import the edgeDark.js file as code and let Node.js handle the parsing, or flip things around and generate edgeDark.js from some templates. There is no reason to do either of these things, though, since we have a working approach for the time being.

@paullinator
Copy link
Member Author

/rebase

@paullinator paullinator merged commit fcf1488 into develop Dec 4, 2025
2 checks passed
@paullinator paullinator deleted the paul/overrideTheme branch December 4, 2025 21:00
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.

3 participants