diff --git a/.claude/worktrees/specs-beta-refresh b/.claude/worktrees/specs-beta-refresh deleted file mode 160000 index 4f4b81ee..00000000 --- a/.claude/worktrees/specs-beta-refresh +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4f4b81ee0f5c02c3886e7758b8fd662f79b73554 diff --git a/.github/workflows/bump-terminal-gui.yml b/.github/workflows/bump-terminal-gui.yml new file mode 100644 index 00000000..23513600 --- /dev/null +++ b/.github/workflows/bump-terminal-gui.yml @@ -0,0 +1,203 @@ +name: Bump Terminal.Gui + +# Keeps in Directory.Build.props tracking Terminal.Gui's +# NuGet publishes. Policy: develop tracks TG's develop pre-releases (Editor is +# a continuous canary for TG API churn); a stable Editor release requires a +# stable pin (enforced by prepare-release.yml). +# +# Flow: +# - Resolve the newest TG version on NuGet for the requested channel +# (default: prerelease = newest overall; stable = newest without a `-`). +# - If it differs from the current pin: bump, build, run the test suites. +# - Green → commit directly to develop (push uses RELEASE_PAT so the push +# triggers release.yml, publishing a new Editor pre-release and dispatching +# downstream to clet). +# - Red → push a `bump/terminal-gui-` branch, open a PR so the +# breakage is visible, and fail this run. +# +# Triggers: +# - repository_dispatch `terminal-gui-published` (sent by gui-cs/Terminal.Gui's +# publish workflow; payload: { "version": "2.4.6-develop.10" }) +# - schedule: fallback poll, in case the dispatch is missing/not configured +# - workflow_dispatch: manual, with channel selection (use channel=stable to +# pin a stable TG ahead of an Editor stable release) + +on: + repository_dispatch: + types: [terminal-gui-published] + schedule: + - cron: '23 */6 * * *' + workflow_dispatch: + inputs: + channel: + description: 'Which TG stream to pin' + required: true + type: choice + options: + - prerelease + - stable + default: prerelease + version: + description: 'Explicit Terminal.Gui version (optional; overrides channel)' + required: false + type: string + +permissions: + contents: write + pull-requests: write + +concurrency: + group: bump-terminal-gui + cancel-in-progress: false + +jobs: + bump: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.RELEASE_PAT }} + # Terminal.Gui drivers skip real-terminal probing/IO on TTY-less runners. + DisableRealDriverIO: "1" + steps: + - name: Checkout develop + uses: actions/checkout@v5 + with: + ref: develop + token: ${{ secrets.RELEASE_PAT }} + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Resolve target Terminal.Gui version + id: resolve + shell: bash + run: | + CURRENT=$(sed -n 's|.*]*>\(.*\).*|\1|p' Directory.Build.props | head -1) + if [ -z "$CURRENT" ]; then + echo "::error::Could not read from Directory.Build.props." + exit 1 + fi + + EXPLICIT="${{ github.event.inputs.version || github.event.client_payload.version }}" + CHANNEL="${{ github.event.inputs.channel || 'prerelease' }}" + + if [ -n "$EXPLICIT" ]; then + TARGET="$EXPLICIT" + else + # Flat-container index is sorted ascending by NuGet semver. + INDEX=$(curl -fsS https://api.nuget.org/v3-flatcontainer/terminal.gui/index.json) + if [ "$CHANNEL" = "stable" ]; then + TARGET=$(echo "$INDEX" | jq -r '[.versions[] | select(contains("-") | not)] | last') + else + TARGET=$(echo "$INDEX" | jq -r '.versions | last') + fi + fi + + if [ -z "$TARGET" ] || [ "$TARGET" = "null" ]; then + echo "::error::Could not resolve a target Terminal.Gui version." + exit 1 + fi + + echo "current=$CURRENT" >> "$GITHUB_OUTPUT" + echo "target=$TARGET" >> "$GITHUB_OUTPUT" + + if [ "$TARGET" = "$CURRENT" ]; then + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "Pin already at ${CURRENT}; nothing to do." + elif git ls-remote --heads origin "bump/terminal-gui-${TARGET}" | grep -q .; then + echo "changed=false" >> "$GITHUB_OUTPUT" + echo "::warning::bump/terminal-gui-${TARGET} already exists (a previous bump to ${TARGET} failed CI). Skipping." + else + echo "changed=true" >> "$GITHUB_OUTPUT" + echo "Bumping TerminalGuiVersion: ${CURRENT} → ${TARGET}" + fi + + - name: Wait for NuGet flat-container to index the target + if: steps.resolve.outputs.changed == 'true' + shell: bash + run: | + TARGET="${{ steps.resolve.outputs.target }}" + # A dispatch from TG's publish workflow can arrive before NuGet has + # indexed the version; restore would fail and mis-report breakage. + for i in $(seq 1 60); do + if curl -fsS https://api.nuget.org/v3-flatcontainer/terminal.gui/index.json \ + | jq -r '.versions[]' | grep -qx "$TARGET"; then + echo "Indexed on flat-container: $TARGET" + exit 0 + fi + echo "Waiting for Terminal.Gui $TARGET on NuGet flat-container ($i/60, 10s each)..." + sleep 10 + done + echo "::error::Timed out waiting for Terminal.Gui $TARGET on flat-container." + exit 1 + + - name: Apply pin + if: steps.resolve.outputs.changed == 'true' + shell: bash + run: | + TARGET="${{ steps.resolve.outputs.target }}" + sed -i "s|\(]*>\)[^<]*\(\)|\1${TARGET}\2|" Directory.Build.props + grep TerminalGuiVersion Directory.Build.props + + - name: Setup .NET + if: steps.resolve.outputs.changed == 'true' + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' + dotnet-quality: 'preview' + + - name: Validate (restore, build, test) + if: steps.resolve.outputs.changed == 'true' + id: validate + continue-on-error: true + shell: bash + run: | + set -euo pipefail + dotnet restore Terminal.Gui.Editor.slnx + dotnet build Terminal.Gui.Editor.slnx --no-restore -c Release + dotnet run --project tests/Terminal.Gui.Editor.Tests --no-build -c Release + dotnet run --project tests/Terminal.Gui.Editor.IntegrationTests --no-build -c Release + dotnet run --project tests/Terminal.Gui.Editor.ConfigTests --no-build -c Release + + - name: Commit to develop (green) + if: steps.resolve.outputs.changed == 'true' && steps.validate.outcome == 'success' + shell: bash + run: | + TARGET="${{ steps.resolve.outputs.target }}" + git add Directory.Build.props + git commit -m "Bump TerminalGuiVersion to ${TARGET}" + # develop may have moved while tests ran; replay the bump on top. + git pull --rebase origin develop + git push origin develop + echo "## Bumped TerminalGuiVersion" >> "$GITHUB_STEP_SUMMARY" + echo "- ${{ steps.resolve.outputs.current }} → ${TARGET} (pushed to develop)" >> "$GITHUB_STEP_SUMMARY" + + - name: Open PR (red) + if: steps.resolve.outputs.changed == 'true' && steps.validate.outcome != 'success' + shell: bash + run: | + TARGET="${{ steps.resolve.outputs.target }}" + CURRENT="${{ steps.resolve.outputs.current }}" + BRANCH="bump/terminal-gui-${TARGET}" + + git checkout -b "$BRANCH" + git add Directory.Build.props + git commit -m "Bump TerminalGuiVersion to ${TARGET}" + git push origin "$BRANCH" + + cat > /tmp/pr_body.md << EOF + Automated bump of \`TerminalGuiVersion\` from \`${CURRENT}\` to \`${TARGET}\` **failed validation** (build or tests). + + Editor needs source changes to absorb this Terminal.Gui update. See the + [failed workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). + EOF + + gh pr create \ + --base develop \ + --head "$BRANCH" \ + --title "Bump TerminalGuiVersion to ${TARGET} (needs fixes)" \ + --body-file /tmp/pr_body.md + + echo "::error::TG ${TARGET} broke the build/tests; opened PR from ${BRANCH}." + exit 1 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index a9e6205f..1972a6e3 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -18,7 +18,7 @@ on: - stable default: stable version_override: - description: 'Version override (optional, e.g., 2.2.4). Defaults to Directory.Build.props without -develop.' + description: 'Version override (optional, e.g., 2.6.0). Defaults to GitVersion''s next patch (latest tag + 1).' required: false type: string @@ -46,6 +46,32 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v4.5.0 + with: + versionSpec: '6.x' + + - name: Run GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v4.5.0 + with: + useConfigFile: true + + - name: Require a stable Terminal.Gui pin for stable releases + if: github.event.inputs.release_type == 'stable' + shell: bash + run: | + TG_PIN=$(sed -n 's|.*]*>\(.*\).*|\1|p' Directory.Build.props | head -1) + if [ -z "$TG_PIN" ]; then + echo "::error::Could not read from Directory.Build.props." + exit 1 + fi + if echo "$TG_PIN" | grep -q -- '-'; then + echo "::error::TerminalGuiVersion is '${TG_PIN}', a pre-release. A stable Editor release must depend on a stable Terminal.Gui (NuGet rejects stable→prerelease dependencies, NU5104). Pin a stable TG on develop first (e.g. via the Bump Terminal.Gui workflow with channel=stable)." + exit 1 + fi + echo "TerminalGuiVersion pin is stable: ${TG_PIN}" + - name: Compute release version id: version shell: bash @@ -53,8 +79,8 @@ jobs: if [ -n "${{ github.event.inputs.version_override }}" ]; then VERSION="${{ github.event.inputs.version_override }}" else - VERSION=$(sed -n 's|.*\(.*\).*|\1|p' Directory.Build.props | head -1) - VERSION="${VERSION%%-*}" + # Next patch over the latest tag reachable from develop (GitVersion.yml: increment Patch). + VERSION="${{ steps.gitversion.outputs.MajorMinorPatch }}" fi RELEASE_TYPE="${{ github.event.inputs.release_type }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30437938..926acd74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,14 +3,14 @@ name: Release # Publishes Terminal.Gui.Editor to NuGet. # # Triggers: -# 1. Push of a `v*` tag (canonical release path, e.g. v2.1.0) +# 1. Push of a `v*` tag (canonical release path, e.g. v2.5.3) # → Version = tag with leading `v` stripped. -# 2. Push to `develop` (rolling pre-release smoke test) -# → Version = from Directory.Build.props + "." -# e.g. 2.1.1-develop.7 +# 2. Push to `develop` (rolling pre-release) +# → Version computed by GitVersion from git history + GitVersion.yml, +# e.g. 2.5.3-develop.7 (latest reachable tag + Patch, develop label). # -# The package version is declared in Directory.Build.props. -# The computed value overrides that base via `-p:Version=...`. +# No version is stored in the repo; tags are the source of truth. +# The computed value is injected into builds via `-p:Version=...`. on: push: @@ -31,22 +31,33 @@ jobs: version: ${{ steps.v.outputs.version }} steps: - uses: actions/checkout@v5 + with: + # GitVersion needs full history + tags. + fetch-depth: 0 + + - name: Install GitVersion + if: github.ref_type != 'tag' + uses: gittools/actions/gitversion/setup@v4.5.0 + with: + versionSpec: '6.x' + + - name: Run GitVersion + if: github.ref_type != 'tag' + id: gitversion + uses: gittools/actions/gitversion/execute@v4.5.0 + with: + useConfigFile: true - name: Compute version id: v shell: bash run: | if [ "${{ github.ref_type }}" = "tag" ]; then - # Tag form: v2.1.0 → 2.1.0 + # Tag form: v2.5.3 → 2.5.3 (the tag is canonical; no GitVersion needed) VERSION="${GITHUB_REF_NAME#v}" elif [ "${{ github.ref }}" = "refs/heads/develop" ]; then - # Read base from Directory.Build.props (e.g. "2.1.1-develop"), append run number. - BASE=$(sed -n 's|.*\(.*\).*|\1|p' Directory.Build.props | head -1) - if [ -z "$BASE" ]; then - echo "::error::Could not read from Directory.Build.props." - exit 1 - fi - VERSION="${BASE}.${GITHUB_RUN_NUMBER}" + # GitVersion: latest reachable tag + Patch, develop label, commit count. + VERSION="${{ steps.gitversion.outputs.SemVer }}" else echo "::error::Unsupported trigger: event=${{ github.event_name }} ref=${{ github.ref }}" exit 1 diff --git a/.gitignore b/.gitignore index 2aee5655..fff25bb8 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,6 @@ Thumbs.db .env.* !.env.example BenchmarkDotNet.Artifacts/ + +# Claude Code session worktrees +.claude/worktrees/ diff --git a/CLAUDE.md b/CLAUDE.md index e9bb4917..03077bce 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,15 +13,18 @@ Active development happens on **`develop`**. `main` is the release/stable branch - Work on `develop`. During pre-alpha, direct commits and pushes to `develop` are allowed — no PRs required for routine work. - Do not push directly to `main`. Promotion from `develop` to `main` is a deliberate release step. - Two paths trigger `.github/workflows/release.yml`, which builds + tests cross-platform, then packs and pushes the NuGet package: - - **Push a `v*` tag** (e.g. `v2.1.0`) — canonical stable release; version = tag minus leading `v`. - - **Push to `develop`** — rolling pre-release; version = `` from `Directory.Build.props` + `.${github.run_number}`. With base `2.1.1-develop`, the first run publishes `2.1.1-develop.1`, etc. + - **Push a `v*` tag** (e.g. `v2.5.3`) — canonical stable release; version = tag minus leading `v`. + - **Push to `develop`** — rolling pre-release; version computed by GitVersion (e.g. `2.5.3-develop.7`). - Stable releases are created through **Prepare Release** (`.github/workflows/prepare-release.yml`), which opens a release PR from `develop` to `main`. Merging that PR triggers **Finalize Release** (`.github/workflows/finalize-release.yml`) to create the `v*` tag, GitHub Release, and back-merge PR to `develop`; the tag push triggers NuGet publishing. ## Versioning -`Directory.Build.props` holds a single `` shared by both packages. Track Terminal.Gui's version stream — when the latest stable Terminal.Gui is `X.Y.Z`, our develop base is the next-patch pre-release (e.g. TG 2.1.0 → our base `2.1.1-develop`). Bump the base when TG ships a new stable, not on every commit. The `.${run_number}` suffix is the per-build counter, applied automatically by the workflow. +See `specs/decisions.md` DEC-010. Two independent axes, never conflated: -`` (also in `Directory.Build.props`) pins the Terminal.Gui dependency. Bump it when the project is ready to consume a new TG release; CI/release workflows can override via `-p:TerminalGuiVersion=` if needed. +- **Editor's own version** — computed from git tags by **GitVersion 6** (`GitVersion.yml`, the same GitFlow model Terminal.Gui uses). No version lives in the repo; do not add one. Stable releases are `v*` tags on `main`; develop builds are `-develop.` (always sorts above the latest stable). Local builds without `-p:Version` get the `0.0.0-local` placeholder. Editor's version is **not** coupled to Terminal.Gui's — do not "track TG's stream". +- **``** (`Directory.Build.props`) — the minimum supported Terminal.Gui, i.e. the NuGet dependency floor. On `develop` it tracks TG's develop pre-releases and is bumped automatically by `.github/workflows/bump-terminal-gui.yml` (triggered by TG's publish dispatch, a fallback schedule, or manually): the bump is validated with a full build + all test suites, then committed directly to `develop` on green or opened as a PR from `bump/terminal-gui-` on red. A **stable** Editor release requires a **stable** TG pin — `prepare-release.yml` gates on this (run the bump workflow with `channel=stable` first). Override per-build via `-p:TerminalGuiVersion=`. + +For the inner dev loop against a local TG enlistment, `dotnet build -p:UseLocalTerminalGui=true` swaps the Terminal.Gui PackageReference for a ProjectReference into the sibling `../Terminal.Gui` clone (see `Directory.Build.targets`). It is blocked in CI and for `pack`, and restore assets are mode-specific — re-restore after toggling. ## Build and test @@ -258,4 +261,4 @@ Don't accidentally do these — they were considered and rejected: ## Open decisions -`specs/00-plan.md` §10 lists open design questions (line-ending policy, xshd vs TextMate for first highlighter, async I/O placement, read-only ranges, completion item shape). Resolutions go in `specs/05-decisions.md` (not yet created). If a task touches one of these, surface the decision rather than picking unilaterally. +`specs/00-plan.md` §10 lists open design questions (line-ending policy, xshd vs TextMate for first highlighter, async I/O placement, read-only ranges, completion item shape). Resolutions go in `specs/decisions.md`. If a task touches one of these, surface the decision rather than picking unilaterally. diff --git a/Directory.Build.props b/Directory.Build.props index ab653abe..93bfe93d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,22 +13,30 @@ Copyright (c) gui-cs and contributors - 2.4.1-develop + 0.0.0-local https://github.com/gui-cs/Editor https://github.com/gui-cs/Editor git LICENSE - - 2.4.0 + + 2.4.6 diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 00000000..00b0ea08 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,42 @@ + + + + + $(MSBuildThisFileDirectory)..\Terminal.Gui\Terminal.Gui\Terminal.Gui.csproj + + + + + + + + + + + + + + + + + diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 00000000..e5fc0c2f --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,68 @@ +# GitVersion 6.x configuration for gui-cs/Editor. +# +# Same GitFlow model as gui-cs/Terminal.Gui (see its GitVersion.yml): +# +# - `main` is the release branch; every stable release is a `v*` tag on main. +# - `develop` always carries the `-develop` pre-release label. The version is +# computed from the latest tag reachable from develop, incremented by Patch: +# after v2.5.2 is back-merged, develop builds are 2.5.3-develop.N. +# - Editor's version is INDEPENDENT of Terminal.Gui's version. Which TG a build +# supports is expressed solely by in Directory.Build.props +# (the package dependency), never by mirroring TG's version number. +# +# Nothing in the repo holds a version number; tags are the single source of +# truth. The release workflow runs the GitVersion CLI to compute the version +# and passes it to builds via -p:Version. +# +mode: ContinuousDelivery + +# Tags are prefixed with 'v' or 'V' (e.g., v2.5.2). +tag-prefix: '[vV]' + +branches: + + # Release branch: stable versions come from v* tags on main. + main: + regex: ^main$ + label: '' + increment: Patch + source-branches: ['develop'] + + # Development branch: rolling pre-releases (e.g., 2.5.3-develop.7). + develop: + regex: ^develop$ + label: develop + increment: Patch + source-branches: [] + tracks-release-branches: true + + # Release PR branches created by prepare-release.yml (release/v2.5.3). + # Version label irrelevant: the version is finalized by the v* tag that + # finalize-release.yml creates after the PR merges. + release: + regex: ^release[/-] + label: rc + increment: None + source-branches: ['develop'] + + # Pull request branches (e.g., 2.5.3-PullRequest245.1). + pull-request: + regex: "^(pull|pull\\-requests|pr)[\\/-](?\\d+)" + label: "PullRequest{Number}" + increment: Inherit + source-branches: + - develop + - main + - feature + pre-release-weight: 30000 + + # Feature / fix / topic branches: inherit from develop, label = branch name. + feature: + regex: "^(feature|fix|issue|dependabot|copilot|backmerge|bump)[\\/-](?.+)" + label: "{BranchName}" + increment: Inherit + source-branches: + - develop + +ignore: + sha: [] diff --git a/specs/decisions.md b/specs/decisions.md index 33777407..60dceb7e 100644 --- a/specs/decisions.md +++ b/specs/decisions.md @@ -92,6 +92,18 @@ need to know the document construction details. --- +### DEC-010: Versioning decoupled from Terminal.Gui; TG pin automated + +**Decision**: Editor's package version is **independent** of Terminal.Gui's version stream and is computed from git tags by GitVersion 6 (same `GitVersion.yml` GitFlow model TG itself uses): `v*` tags on `main` are stable releases; `develop` builds are `-develop.`. No version is stored in the repo. Which TG a build supports is expressed **only** by `$(TerminalGuiVersion)` in `Directory.Build.props` — the NuGet dependency floor — never by mirroring TG's version number. On `develop` that pin tracks TG's develop pre-releases and is bumped automatically by `.github/workflows/bump-terminal-gui.yml` (validates with full build + test suites; green → direct commit to develop, red → PR from `bump/terminal-gui-`). A stable Editor release requires a stable pin (gated in `prepare-release.yml`; NuGet rejects stable→prerelease dependencies, NU5104). For the inner dev loop, `-p:UseLocalTerminalGui=true` swaps the PackageReference for a ProjectReference into the sibling `../Terminal.Gui` enlistment (blocked in CI and for pack; see `Directory.Build.targets`). + +**Rationale**: The original "track TG's stream" rule conflated package identity with dependency compatibility and was hand-maintained, and it broke in practice: Editor shipped stables 2.4.1→2.5.2 via `version_override` while the props base stayed `2.4.1-develop`, so develop pre-releases (`2.4.1-develop.N`) sorted *below* the published 2.5.2 stable, and "Editor 2.5.x" implied a TG 2.5 that doesn't exist (TG stable was 2.4.5). NuGet immutability forecloses re-coupling (Editor can never rewind behind TG's stream). Tag-derived versions cannot go stale, need no back-merge bookkeeping, and match the machinery TG already operates. Tracking TG develop pre-releases makes Editor a continuous canary for TG API churn while both projects are pre-alpha; the first automated-bump dry run immediately caught a real change (TG's checked-menu glyph `☒`→`☑`). + +The TG→Editor reverse dependency stays rational because it is **package-acyclic**: only TG's non-packaged assets consume Editor (`Examples/UICatalog` and `Tests/NativeAotSmoke` via a CPM pin in `Directory.Packages.props`, `docfx/EditorRef` via a floating `*`); the Terminal.Gui package itself never depends on Editor. Both directions resolve through *published* NuGet versions, so there is no build-graph cycle. Caution for any future TG-side auto-bump of its Editor pin: such commits must not trigger TG's publish workflow, or the two repos' bump-publish automations would ping-pong indefinitely. + +**Date**: 2026-06-11 + +--- + ## Open ### OPEN-001: Independent `Terminal.Gui.Editor` NuGet from day one diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs index 2fd30b9d..c64dc222 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/TedAppTests.cs @@ -6,6 +6,7 @@ using System.Text; using Ted; using Terminal.Gui.Configuration; +using Terminal.Gui.Drawing; using Terminal.Gui.Editor.Indentation; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; @@ -682,7 +683,7 @@ public async Task ViewMenu_TogglesLineNumbers_ViaKeyboard () fx.Render (); DriverAssert.ContentsContains (fx.Driver, "Line Numbers"); - DriverAssert.ContentsContains (fx.Driver, "☒ Line Numbers"); + DriverAssert.ContentsContains (fx.Driver, $"{Glyphs.CheckStateChecked} Line Numbers"); DriverAssert.ContentsContains (fx.Driver, "Show Tabs"); fx.Injector.InjectKey (Key.Enter, options); @@ -693,7 +694,7 @@ public async Task ViewMenu_TogglesLineNumbers_ViaKeyboard () fx.Injector.InjectKey (Key.V.WithAlt, options); fx.Render (); - DriverAssert.ContentsContains (fx.Driver, "☐ Line Numbers"); + DriverAssert.ContentsContains (fx.Driver, $"{Glyphs.CheckStateUnChecked} Line Numbers"); fx.Injector.InjectKey (Key.Enter, options); fx.Render (); diff --git a/tests/Terminal.Gui.Editor.IntegrationTests/TedSettingsPersistenceTests.cs b/tests/Terminal.Gui.Editor.IntegrationTests/TedSettingsPersistenceTests.cs index 7e2ee0e4..4985403d 100644 --- a/tests/Terminal.Gui.Editor.IntegrationTests/TedSettingsPersistenceTests.cs +++ b/tests/Terminal.Gui.Editor.IntegrationTests/TedSettingsPersistenceTests.cs @@ -4,6 +4,7 @@ using System.Reflection; using System.Text.Json.Nodes; using Ted; +using Terminal.Gui.Drawing; using Terminal.Gui.Editor.IntegrationTests.Testing; using Terminal.Gui.Input; using Terminal.Gui.Testing; @@ -101,7 +102,7 @@ public async Task ViewMenu_WordWrap_Toggle_Creates_ConfigFile () Assert.True (y >= 0); var x = -1; // Prefer label text as the click target; glyph fallbacks handle renderer differences. - string[] targets = ["Word Wrap", "☐", "☑"]; + string[] targets = ["Word Wrap", Glyphs.CheckStateUnChecked.ToString (), Glyphs.CheckStateChecked.ToString ()]; foreach (var target in targets) { x = menuLines[y].IndexOf (target, StringComparison.Ordinal);