Add code-token VisualRoles, Code view, theme palettes, and Markdown highlighting fixes#5313
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/87c31cb1-c209-40bb-a480-6f3fbe9e8d55 Co-authored-by: tig <585482+tig@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb8c1f7be6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This comment was marked as outdated.
This comment was marked as outdated.
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/716ef4d6-34b7-4e16-a9ca-7494cf2d3d03 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Fixed in 45ac4fc. Default now gets an explicit Code* palette, and Code View Demo now lays the code panel below the full theme selector so all themes are visible. I captured an updated UI screenshot during validation at Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…//github.com/gui-cs/Terminal.Gui into copilot/add-code-token-visualrole-vocabulary
This comment was marked as outdated.
This comment was marked as outdated.
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ef7d2993-1886-4dde-8edf-00c3e179b2e7 Co-authored-by: tig <585482+tig@users.noreply.github.com>
…//github.com/gui-cs/Terminal.Gui into copilot/add-code-token-visualrole-vocabulary
Fixed in a5e4751. Added Code/Code* palettes for the non-Default built-in and UICatalog themes, kept 8-Bit monochrome, and made token backgrounds inherit the Code background so Dark/Light/etc. render consistently. Updated screenshot captured at |
|
@copilot make the Code.EnableForDesign include code that shows every code visualstyle. Same for all the examples in the CodeViewDemo scenario. |
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d40d66b5-826e-4e91-9c78-882d18e58b6c Co-authored-by: tig <585482+tig@users.noreply.github.com>
Fixed in 07aeabe. |
…//github.com/gui-cs/Terminal.Gui into copilot/add-code-token-visualrole-vocabulary
DeriveAccent now copies every Code* attribute from baseScheme (resolved via GetAttributeForRole) into the accent scheme as explicitly set values. Because GetAttributeForRole walks the derivation chain, even unset code-token roles on the base scheme become explicit on the accent. This means: (a) accent schemes will report TryGetExplicitlySetAttributeForRole(VisualRole.CodeXxx) as true even though the original theme didn't set them, and (b) future changes to baseScheme's Code attribute will no longer propagate to the accent's code tokens because the accent now pins concrete copies. Consider only copying values that were explicitly set on the base scheme (using TryGetExplicitlySetAttributeForRole) so derivation continues to work. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/89b866c3-6b09-44f6-b2b0-e4f10515d475 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/89b866c3-6b09-44f6-b2b0-e4f10515d475 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Phase 2 of specs/syntax-theme/spec.md. Routes the xshd highlighter through Terminal.Gui's Scheme/VisualRole machinery so themes drive syntax colors and the editor background follows the active scheme (fixes #128; restores #99's theme story via ThemeManager). - XshdRoleMap: xshd <Color name> -> VisualRole.Code* bridge table (spec 6.2) - HighlightingColor.Role + xshd category= override (XshdColor/V2Loader/ XmlHighlightingDefinition/SaveXshdVisitor); logged in UPSTREAM.md - HighlightingColorizer.ToAttribute resolves: explicit scheme role -> xshd foreground over scheme bg -> default; ctor takes role-lookup funcs - Removed Editor.UseThemeBackground end-to-end (theme decides bg now) - Editor repaints on ThemeManager.ThemeChanged - ted: status-bar Theme shortcut cycles ThemeManager.Theme - Tests: scheme-role / xshd-fallback / XshdRoleMap coverage / category override (unit) + scheme-swap render smoke (integration). 439 + 174 green. Blocked on tui-cs/Terminal.Gui#5313 (code-token VisualRoles) reaching a published develop pre-release. <TerminalGuiVersion> must be bumped to that build before CI can go green; verified locally against a #5313 pack via -p:TerminalGuiVersion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…//github.com/gui-cs/Terminal.Gui into copilot/add-code-token-visualrole-vocabulary
tui-cs/Terminal.Gui#5313 (code-token VisualRoles) is published on the develop NuGet feed as 2.1.1-develop.95 (later .125-.163 are bad/unlisted). Bumped <TerminalGuiVersion> off the placeholder and removed the TODO. Verified against the real published package: build 0 warnings/0 errors, Tests 439/439, IntegrationTests 190/190, dotnet format clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixes
Adds shared, theme-driven code-token visual roles for syntax-highlighted content across Markdown, the new
Codeview, UICatalog samples, and downstream editor scenarios. Fixes code-block highlighting for MarkdownTester by preserving explicitly configured Base code-token roles in derived Accent schemes.Proposed Changes/Todos
VisualRole.CodeCommentthroughVisualRole.CodeAttributewithSchemestorage, JSON round-trip support, and fallback behavior.Code/Code*palettes, preserving 8-Bit monochrome behavior.MarkdownCodeBlockrendering to resolve TextMate-highlighted tokens throughVisualRole.Code*.Codeview for syntax-highlighted code display.Code.EnableForDesignandCodeViewDemoto avoid duplicated marker logic.DeriveAccentso only explicitly set Base code-token roles are copied into Accent schemes.Coderendering, and design-time role coverage.Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)