Repository navigation
style(editor): dark-theme syntax palette + multi-issue validation report - #111
Merged
Merged
Conversation
added 2 commits
November 4, 2026 17:40
The editor inherited CodeMirror's defaultHighlightStyle through basicSetup (fallback) - a LIGHT-background palette: dark browns (#940), teals (#164), navy blues (#00c) and purples (#708) that are nearly unreadable on the dark #1e1e1e canvas. Fix: configure a NON-fallback HighlightStyle mapping the tags the YAML parser actually emits (@lezer/yaml styleTags) onto new --app-editor-syntax-* tokens, defined in both theme blocks like every --app-editor-* token: - keys (propertyName + definition) -> key blue - quoted strings + plain/block scalars (tags.content) -> string color - comments -> comment green - directives and YAML tags -> keyword blue - anchors/aliases -> teal Punctuation inherits the base text color; var() references make the palette follow the light/dark switch automatically. Test: syntax-highlighting token-backed test (mounted style rules carry var(--app-editor-syntax-*), source configures the non-fallback style, tokens defined in both theme blocks). @codemirror/language and @lezer/highlight declared as direct dependencies. dist rebuilt. Full web suite: 242 passed.
The editor's validator surfaced only the FIRST problem in a draft:
validate_issues() caught a single ValueError from ConfigReader.from_content,
whose exception-based pipeline (strict parse -> semantic validate ->
Pydantic schema) fails fast at the first violation. A draft with several
mistakes showed one error, was fixed, then revealed the next one.
New core module profiles.core.config.diagnostics:
- collect_config_issues(text) reports EVERY problem as
{"severity": "error", "message": ...}, never raising:
- YAML syntax error -> single issue (the ruamel parser stops there;
no tree exists to validate until it is fixed)
- semantic issues collected exhaustively (validator.collect_issues:
every unknown top-level key, every unknown extends, every cycle)
- every Pydantic schema error, formatted with its dotted path
(e.g. 'defaults.search_dir: Input should be a valid string')
- validator.validate() keeps its fail-fast contract, now implemented on
top of collect_issues (DRY); the cycle DFS also guards non-dict config
entries instead of raising AttributeError.
server/routes/config.py: validate_issues() delegates to the collector
(display_name dropped - the editor header already names the file; the
drop-overlay path keeps ConfigReader.from_content unchanged). /validate,
/save and /save-as gates now see the full issue list.
Tests: collect_issues suite, collect_config_issues suite, /validate
multi-issue endpoint test. AGENTS.md + tests/AGENTS.md trees updated.
Subset: 40 passed; full suite green in the touched areas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent editor fixes found while using the config editor on main.
1. Dark-theme syntax palette (f7c97d3, follows up #98)
Root cause of the bad dark-theme colors: the editor inherited CodeMirror's
defaultHighlightStylethroughbasicSetup(fallback: true) — a light-background palette (#940browns,#164teals,#00cnavy,#708purple) that is nearly unreadable on the dark#1e1e1ecanvas. Every YAML key, string and comment on the dark canvas was drawn with washed-out dark-on-dark colors.Fix: a NON-fallback
HighlightStylemapping the tags the YAML parser actually emits (@lezer/yamlstyleTags) onto new--app-editor-syntax-*tokens, defined in both theme blocks like every--app-editor-*token (issue #98 pattern):--app-editor-syntax-key#9cdcfe#0451a5propertyName+definition)--app-editor-syntax-string#ce9178#a31515tags.content)--app-editor-syntax-comment#6a9955#008000--app-editor-syntax-keyword#569cd6#0000ff--app-editor-syntax-label#4ec9b0#267f99var()references make the palette follow the light/dark switch automatically.@codemirror/languageand@lezer/highlightare now declared direct dependencies. dist rebuilt.2. Multi-issue validation report (01ce306)
Investigation result: the editor showed only the first error because everything was exception-based and fail-fast —
validate_issues()caught a singleValueErrorfromConfigReader.from_content, whose pipeline (strict parse → semantic validate → Pydantic schema) raises at the first violation. Fix one error, and the next one appeared on the next Test.Fix: new core module
profiles.core.config.diagnostics—collect_config_issues(text)reports every problem without raising:extends, every cycle (validator.collect_issues;validate()keeps its fail-fast contract, implemented on top of it — DRY)/api/config/validate,/saveand/save-asgates now receive the full issue list; the drop-overlay path keepsfrom_contentunchanged.Before → after for one draft (
relese:typo, badextends, ana↔bcycle, wrongtheme,search_dir: 42, negative depth):— previously only the first of these was displayed.
Verification
tsc -bclean; dist rebuilt.collect_issues+collect_config_issuessuites +/validatemulti-issue test). Full suite: failures unchanged in touched areas; the delta vs the Windows baseline (test_save_image_delegates_to_core_and_reports_pathpath separators,test_build_env_falls_back_to_node_dirsnode PATH) is environmental and unrelated.ruff check+ruff formatclean; AGENTS.md and tests/AGENTS.md trees updated for the new module.