Skip to content

Convert legacy theme assets to semantic copies - #358

Merged
Eli Pinkerton (wallstop) merged 2 commits into
masterfrom
feat/a2-legacy-theme-conversion
Nov 24, 2026
Merged

Eli Pinkerton (wallstop) merged 2 commits into
masterfrom
feat/a2-legacy-theme-conversion

Conversation

@wallstop

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why:
Existing theme assets need an Editor action to adopt semantic color roles.
Part of #238.

What:

  • Create a semantic copy from the Assets menu.
  • Map legacy input and log colors and fill new roles.
  • Generate a stylesheet under an unused name.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds semantic role mapping for legacy theme colors and an Editor menu command that creates and selects a semantic copy. It also adds conversion tests and updates the project documentation and changelog.

Changes: Legacy theme conversion

Layer / File(s) Summary
Map legacy colors to semantic roles
Runtime/CommandTerminal/Themes/TerminalThemeRoles.cs, Runtime/CommandTerminal/Themes/TerminalThemeAsset.cs
Adds constructors for semantic role colors and a method that creates a semantic theme copy using legacy color fields.
Editor conversion command and validation
Editor/CustomEditors/TerminalThemeAssetEditor.cs, Tests/Editor/TerminalThemeConversionTests.cs, Tests/Editor/TerminalThemeConversionTests.cs.meta, README.md, CHANGELOG.md
Adds a menu command that converts an eligible legacy theme, finds an available asset and stylesheet path, and selects the copy. Tests check role mapping, defaults, generated output, and source preservation. Documentation describes conversion behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • Issue 238: The PR adds the legacy-theme conversion menu item and creates semantic copies, which matches part of the issue’s stated objective.
  • Issue 331: The PR maps legacy theme colors to semantic roles. The retrieved issue also describes OKLCH repair, which is not covered by the supplied change summary.
Merge Risk: Minimal · up to 41eb2

This adds an Editor menu action that creates a semantic copy of a legacy theme without modifying the original. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: legacy theme assets are converted into semantic-role copies. The raw summary shows CreateSemanticCopy(), an Assets menu command, and tests for this conversion, so the…
Description check Passed The description states the purpose (an Editor action so existing theme assets can adopt semantic color roles, part of #238) and lists the changes: an Assets menu copy action, mapping of legacy input a…
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 states the main change: legacy theme assets are converted into semantic-role copies. The raw summary shows CreateSemanticCopy(), an Assets menu command, and tests for this conversion, so the title matches the changeset.

Full details: Description check

Explanation

The description states the purpose (an Editor action so existing theme assets can adopt semantic color roles, part of #238) and lists the changes: an Assets menu copy action, mapping of legacy input and log colors, and generation of a stylesheet under an unused name. These match the raw summary.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review details

Context from checks skipped due to timeout: 2

  • GitHub Check: CodeRabbit
  • GitHub Check: Package tests (Unity 6000.5.2f1)
Additional context used

Code guidelines: 1

.llm/context.md — auto-discovered
Path-based instructions: 2

Applicability reference: AGENTS.md: # Repository Guidelines See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

CodeRabbit inference engine (.llm/context.md)

Files:

  • Editor/CustomEditors/TerminalThemeAssetEditor.cs
  • Runtime/CommandTerminal/Themes/TerminalThemeAsset.cs
  • Runtime/CommandTerminal/Themes/TerminalThemeRoles.cs
  • Tests/Editor/TerminalThemeConversionTests.cs
Applicability reference: AGENTS.md: # Repository Guidelines See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

CodeRabbit inference engine (.llm/context.md)

Files:

  • CHANGELOG.md
  • Editor/CustomEditors/TerminalThemeAssetEditor.cs
  • Runtime/CommandTerminal/Themes/TerminalThemeAsset.cs
  • Runtime/CommandTerminal/Themes/TerminalThemeRoles.cs
  • Tests/Editor/TerminalThemeConversionTests.cs
  • Tests/Editor/TerminalThemeConversionTests.cs.meta
Learnings: 4

Common learnings

Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T06:15:37.199Z
Learning: Applies to CHANGELOG.md : Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### CHANGELOG (user-facing only)

`CHANGELOG.md` records only changes a package consumer can observe: public API and serialized-data changes, behavior changes, fixes, install-size or console-output changes.
Internal work (refactors, tooling, style enforcement, linters, measurement, CI lanes) stays out, and so do internal numbers - those live in PR descriptions, issues, and `progress/`
logs. Entries follow the unity-helpers style: verb-first (`Add`/`Fix`/`Change`), one sentence per user-observable change, issue reference at the end. Keep bullets in the same
category together without blank lines.
Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T23:02:17.138Z
Learning: Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### Unity Package Rules

1. Every visible file/folder needs a `.meta` file (see existing `*.meta`). Dot-prefixed paths (`.llm/`, `.github/`, `.config/`, `.git/`) are ignored by Unity - never add `.meta`
   for them. Enforced by `tooling~/scripts/lint_unity_meta.py` (typed python under uv, issue #220; pre-commit hook `unity-meta-lint` and the Unity Meta Lint workflow): orphan
   metas, missing metas, and guid uniqueness over tracked files. See [create-unity-meta](./skills/create-unity-meta/SKILL.md).
Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T06:15:37.199Z
Learning: Applies to **/*.cs : Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### C# Code Rules

2. All code is formatted via [CSharpier](https://csharpier.com/): `dotnet tool run csharpier format` (tools pinned in `.config/dotnet-tools.json`, enforced by pre-commit). Do not
   hand-format.
Learning: 2026-11-23T06:15:37.199Z

Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T06:15:37.199Z
Learning: Applies to **/*.cs : Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### C# Code Rules

25. UnityEngine.Object null checks use the Unity `==`/`!=` operators explicitly. Banned on Unity objects: `?.`, `??`/`??=`, `is null`/`is not null`/`ReferenceEquals` (all bypass
    the fake-null operator), `Assert.IsNull`/`Assert.IsNotNull` in tests, and implicit truthiness - write `component != null` / `Assert.That(x == null)`. `lint:unity-null-patterns`
    enforces the Assert half (`:fix` converts); the repo-internal `UnityObjectNullPatternAnalyzer` DxCmd0001-0005 type-checks the rest, warnaserror fails the compile; it never
    ships and no-ops outside the repo's assemblies - keep both layers (issues #98/#100). Delegate `?.`/plain C# `??` stay legal.

Applied to files:

  • Editor/CustomEditors/TerminalThemeAssetEditor.cs
  • Tests/Editor/TerminalThemeConversionTests.cs
Learning: 2026-11-23T06:15:37.199Z

Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T06:15:37.199Z
Learning: Applies to **/*.cs : Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### C# Code Rules

3. Explicit types over `var`; explicit access modifiers on every member. Use braces for all function bodies and property accessors, including small forwarding methods and lambdas.
   Expression-bodied members and expression lambdas are forbidden. Switch-expression arms keep their required `=>` syntax.

Applied to files:

  • Runtime/CommandTerminal/Themes/TerminalThemeAsset.cs
  • Runtime/CommandTerminal/Themes/TerminalThemeRoles.cs
Learning: 2026-11-23T06:15:37.199Z

Learnt from: CR
Repo: Ambiguous-Interactive/DxTerminal PR: 0
File: .llm/context.md:0-0
Timestamp: 2026-11-23T06:15:37.199Z
Learning: Applies to **/*.cs : Applicability reference:
AGENTS.md: # Repository Guidelines
See the [AI Agent Guidelines](./.llm/context.md) for all AI agent guidelines.

Source excerpt:
# LLM Agent Instructions

## Critical Rules Summary

### C# Code Rules

7. String comparisons state their rule: `string.Equals(a, b, StringComparison.Ordinal|OrdinalIgnoreCase)`; string-typed `IndexOf`/`StartsWith`/`EndsWith`/`Contains`/`Replace` take
   an explicit `StringComparison` - never culture-sensitive defaults, never `==`/`!=` on string values (`== null`, enums, and Unity references stay legal). Name-shaped identifiers
   (font/theme/command names) are `OrdinalIgnoreCase`; string-keyed `Dictionary`/`HashSet` constructions state their comparer too (`StringComparer.Ordinal` when the default is
   meant). Enforced by `npm --prefix tooling~ run lint:string-equality` (pre-commit
    - CI; identifier-vs-identifier equality and collection comparers are review conventions).

Applied to files:

  • Tests/Editor/TerminalThemeConversionTests.cs
OpenGrep (1.33.1)

Tests/Editor/TerminalThemeConversionTests.cs

[WARNING] 37-37: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

[WARNING] 38-38: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

[WARNING] 58-58: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

[WARNING] 64-64: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

[WARNING] 65-65: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

[WARNING] 66-66: File operation with dynamic path can lead to path traversal. Validate and sanitize file paths against a safe base directory.

(coderabbit.path-traversal.csharp-file-read)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

DISCLOSURE: LLM-GENERATED TEXT

OpenAI review: 0 findings.

I found no code defects in this change.

9426 in, 2609 out tokens. Comments only; this review never blocks a merge.

@wallstop
Eli Pinkerton (wallstop) merged commit febb864 into master Nov 24, 2026
21 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the feat/a2-legacy-theme-conversion branch November 24, 2026 06:57
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.

1 participant