Skip to content

Port ted settings UX from clet edit: immediate settings persistence via View/Options, no save-on-quit#123

Merged
tig merged 39 commits into
developfrom
copilot/port-settings-ui-to-ted
May 16, 2026
Merged

Port ted settings UX from clet edit: immediate settings persistence via View/Options, no save-on-quit#123
tig merged 39 commits into
developfrom
copilot/port-settings-ui-to-ted

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

  • Inspect latest GitHub Actions runs and failing logs for this branch
  • Reproduce the exact failing CI job locally
  • Apply minimal fix to make all CI tests pass
  • Run required local validation commands and relevant test projects
  • Run final parallel validation
  • Reply to actionable PR comment with commit hash and screenshot reference

Copilot AI assigned Copilot and tig May 15, 2026
Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Port settings UI from clet edit to ted Port ted settings UX from clet edit: persisted settings, View/Options menus, and Settings dialog May 15, 2026
Copilot finished work on behalf of tig May 15, 2026 13:06
Copilot AI requested a review from tig May 15, 2026 13:06
@tig tig marked this pull request as ready for review May 15, 2026 14:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18dd69adbf

ℹ️ 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".

Comment thread examples/ted/EditorSettings.cs Outdated
Comment thread examples/ted/TedApp.cs
Comment thread examples/ted/EditorSettings.cs Outdated
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot see cr comments and address

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot see cr comments and address

Addressed the CR feedback in b617477.

Changes made:

  • Kept first-run defaults aligned with Editor defaults (UseThemeBackground = true, AutoIndent = true).
  • Moved config file creation inside the guarded save path so setup failures are caught/logged.
  • Added focused TedApp integration coverage for these default behaviors.

Screenshot (updated ted View menu UI): /tmp/ted-ui-after-cr.png

Copilot finished work on behalf of tig May 15, 2026 14:38
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot ci/cd is failing.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot ci/cd is failing.

Fixed in 2912c52.

CI was failing on ubuntu at dotnet format --verify-no-changes due to whitespace in examples/ted/EditorSettings.cs; I applied the formatter-required indexer spacing and pushed.

No UI behavior changed in this fix; screenshot reference remains: /tmp/ted-ui-after-cr.png.

Copilot finished work on behalf of tig May 15, 2026 15:59
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot bring the clet settings tests over. Right now, user testing shows settings are not being saved. E.g. I change tab indent and no ~/.tui/ted.config.json is created.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@copilot ci cd is failing again. You must endure all tests pass before committing!

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot ci cd is failing again. You must endure all tests pass before committing!

Fixed in e450119.

I investigated the failing CI jobs (macOS + Windows), reproduced the failure locally, and stabilized the flaky integration test that was failing (TedSettingsPersistenceTests.ViewMenu_WordWrap_Toggle_Creates_ConfigFile).

I re-ran full local validation before committing:

  • dotnet format Terminal.Gui.Editor.slnx --verify-no-changes --exclude third_party/
  • dotnet build Terminal.Gui.Editor.slnx
  • dotnet run --project tests/Terminal.Gui.Editor.Tests
  • dotnet run --project tests/Terminal.Gui.Editor.IntegrationTests

Screenshot (no UI layout change): /tmp/ted-ui-after-cr.png

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:

  • www.jetbrains.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=TG.Editor Full Cleanup --no-build --exclude=third_party/**/* (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f0726f6a9

ℹ️ 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".

Comment thread examples/ted/TedApp.cs
Comment thread tests/Terminal.Gui.Editor.IntegrationTests/TedSettingsPersistenceTests.cs Outdated
tig and others added 3 commits May 16, 2026 10:32
The wordWrapCheckBox.ValueChanged handler conflicted with the MenuItem's
Action handler. When the Menu dispatches Activate to the MenuItem (Shortcut)
with a binding context, the relay dispatch activates the CheckBox first
(triggering ValueChanged → sets WordWrap=true + saves), then fires Action
(which computes !WordWrap=false + saves). Net result: WordWrap reverts to
false and the config file contains the wrong value.

The fix removes the ValueChanged handler entirely. The Action handler
already correctly toggles Editor.WordWrap, updates the CheckBox, and
calls SaveViewSettings(). This matches the pattern used by the other
View menu checkboxes (Line Numbers, Fold Indicators, ShowTabs, etc.).

Added test ViewMenu_WordWrap_Toggle_Persists_True that:
- Opens View menu via Alt+V (matching real user interaction)
- Clicks Word Wrap menu item
- Asserts Editor.WordWrap == true after toggle
- Asserts config file is created with correct content

The test fails without the fix (WordWrap reverts to false) and passes
with it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three bugs fixed:

1. Config path: GetConfigPath() used %APPDATA%\tui on Windows instead of
   ~/.tui (%USERPROFILE%\.tui). Now uses HOME env var with .tui subdirectory
   on all platforms, matching clet config/edit convention.

2. No explicit Load: settings were never read from ted.config.json on
   startup. TedApp constructor read EditorSettings statics which were at
   their C# defaults. Added EditorSettings.Load() that parses the JSON
   file and populates statics. Called from Program.cs before TedApp
   construction.

3. ConfigurationManager.Load+Apply after every save: Save() called
   ConfigurationManager.Load(All) + Apply() which could reset
   EditorSettings statics to defaults, causing cross-setting interference
   (e.g., ShowTabs and WordWrap undoing each other). Removed — the JSON
   file write is sufficient.

Also:
- Made GetConfigPath() internal for testability
- Added InternalsVisibleTo for test project
- Added Load_Reads_Settings_From_ConfigFile test
- Added Load_TedApp_Applies_Persisted_WordWrap test
- Simplified ConfigPathScope (no longer needs APPDATA redirect)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use NumericUpDown.ValueChanging to reject values below 1 instead of
clamping after the fact in ApplyTo. The Math.Max(1, ...) guard in
ApplyTo remains as a safety net.

Updated test to verify the rejection behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89d2e27b6d

ℹ️ 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".

tig and others added 2 commits May 16, 2026 15:43
Load_Reads_Settings_From_ConfigFile and Load_TedApp_Applies_Persisted_WordWrap
modify EditorSettings static properties (e.g., WordWrap=true) but didn't
restore defaults. On macOS/Linux where test execution order differs from
Windows, this polluted subsequent tests (ViewMenu_WordWrap_Toggle_Persists_True
expected WordWrap=false initially).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged Load_Reads_Settings_From_ConfigFile and
  Load_TedApp_Applies_Persisted_WordWrap into a single
  Load_TedApp_Applies_Persisted_Settings test that asserts via
  TedApp.Editor instance properties (not EditorSettings statics)
- Moved EditorSettings statics reset into ConfigPathScope.Dispose so
  every test that uses a scope gets clean static state automatically
- Removed standalone ResetEditorSettingsDefaults helper

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 504654a7a3

ℹ️ 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".

Comment thread examples/ted/EditorSettings.cs Outdated
Comment thread examples/ted/EditorSettings.cs Outdated
ReadBool and ReadInt used unanchored regex that could match keys inside
// comments, loading stale/wrong values from JSONC config files.

Fixed by anchoring to start-of-line with a negative lookahead for
leading //. Added Load_Skips_Commented_Out_Settings test.

Addresses Codex review P2 findings on EditorSettings.cs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61bf634a52

ℹ️ 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".

Comment thread examples/ted/EditorSettings.cs Outdated
Comment thread examples/ted/EditorSettings.cs Outdated
tig and others added 2 commits May 16, 2026 19:20
- ReadBool/ReadInt: require key at JSON property position (only
  whitespace before quoted key), preventing false matches from keys
  embedded inside string values on the same line.
- Save: use FindRootClosingBrace() that skips any '}' on lines
  starting with '//', preventing insertion into trailing JSONC comments.
- Added regression tests for both scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f0493aeaf

ℹ️ 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".

Comment thread examples/ted/EditorSettings.cs
@tig tig merged commit 3a3c86f into develop May 16, 2026
8 checks passed
@tig tig deleted the copilot/port-settings-ui-to-ted branch May 16, 2026 23:35
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.

Port settings UI from clet edit to ted

2 participants