Skip to content

fix(cli): accept uppercase JSON theme file extensions - #42672

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
jadelike-wine:codex/fix-theme-json-extension
Nov 25, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
jadelike-wine:codex/fix-theme-json-extension

Conversation

@jadelike-wine

Copy link
Copy Markdown
Contributor

Problem

t3 theme set nightfall.JSON treats the file name as a theme ID and exits with an error. A path such as ./nightfall.JsOn reaches the file handler, but it leaves the extension in the default theme ID and fails validation.

Change

Use the same case-insensitive JSON suffix for recognizing a theme file argument and deriving its default ID. The published file is nightfall.json and the selected ID is nightfall.

Scope

This is a small CLI fix with a standalone reproduction below. It follows the existing file-path behavior exercised in #41737.

Verification

I ran the real CLI on macOS with Node 26.13.1. Each command used a fresh temporary base directory and the same valid theme JSON.

Argument to t3 theme set Upstream ca81b7b97a With the fix
nightfall.JSON Exit 1, invalid theme ID Exit 0, publishes and selects nightfall
./nightfall.JsOn Exit 1, invalid ID derived from the file name Exit 0, publishes and selects nightfall
nightfall.json Exit 0, publishes and selects nightfall Exit 0, publishes and selects nightfall

The published JSON matched the source bytes in every successful run. Both new cases failed on upstream and passed with the fix.

vp run check:changed upstream/main passed, including typechecking three packages and running all 19 selected tests.

Model: GPT-6.2 Sol. Harness: Codex Desktop.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Theme publishing now recognizes .json extensions regardless of letter case when detecting file paths and deriving theme IDs. Tests cover .json and .JSON inputs and verify normalized publication.

Changes: Theme JSON extension handling

Layer / File(s) Summary
Recognize and normalize JSON paths
apps/server/src/cli/theme.ts, apps/server/src/cli/theme.test.ts
Path detection recognizes .json suffixes without regard to case. Filename-based theme ID derivation removes case variants of the suffix. Tests verify normalized publication for lowercase and uppercase extensions.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: only21mil, stienswout

Merge Risk: Minimal · up to c27eb

Theme file arguments with uppercase or mixed-case .json extensions are now recognized as file paths and publish under the derived theme ID. The change is narrow and tested, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the CLI now accepts uppercase JSON theme file extensions. The raw summary confirms the case-insensitive .json matching in theme.ts and the matching test update. The …
Description check Passed The description covers the problem, the change, scope, and verification. It states the bug, the case-insensitive suffix fix, and a link to related issue #41737. It reports a before/after table, a macO…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the CLI now accepts uppercase JSON theme file extensions. The raw summary confirms the case-insensitive .json matching in theme.ts and the matching test update. The title is specific and follows the conventional commit style.

Full details: Description check

Explanation

The description covers the problem, the change, scope, and verification. It states the bug, the case-insensitive suffix fix, and a link to related issue #41737. It reports a before/after table, a macOS run with a Node version, and a check run. The template's Scope section asks for an issue link or a reason no issue is needed. The author gives a reason but does not link an issue that shows the bug. The description also omits the template's leading CONTRIBUTING.md reminder, which is an HTML comment and not a required section. The description meets the template's core requirements.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b4bd1f2 and c27eb9f.

Files selected for processing: 1

  • apps/server/src/cli/theme.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 25, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Ran the built CLI on Linux x86_64 with Node v26.13.1. Created identical Nightfall fixtures and ran theme set nightfall.json, theme set nightfall.JSON, and theme set ./nightfall.JsOn, each with a fresh --base-dir. Checked exit status, published file and selected theme.

Before After
d8354f83e4 c27eb9fae0
Before: uppercase and mixed-case extensions fail After: all three extensions publish and select nightfall

Images render captured CLI transcripts and filesystem observations. Lowercase succeeds on both commits. Base rejects uppercase and mixed-case filenames; head publishes nightfall.json and sets defaultTheme to nightfall for all three.

Reproduction driver · Capture renderer · Before transcript · After transcript

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 25, 2026
@juliusmarminge
juliusmarminge merged commit 16acd71 into pingdotgg:main Nov 25, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants