Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5ecedf8
Initial plan
Copilot Jan 9, 2026
154a4b5
Add comprehensive command propagation analysis document
Copilot Jan 9, 2026
b70f54c
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 13, 2026
e1921ff
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 15, 2026
93b9e82
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 15, 2026
0a11595
New workflow that will analyze the dmp file on the macos runner.
tig Jan 16, 2026
e4533a3
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 16, 2026
a123bef
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 16, 2026
50d3703
Merge pull request #58 from tig/macos-hang-dump-analysis
tig Jan 16, 2026
1380956
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 19, 2026
e2dc2b2
Merge branch 'v2_develop' into v2_develop
tig Jan 19, 2026
5e71dc5
Merge branch 'v2_develop' into v2_develop
tig Jan 19, 2026
975c7eb
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 19, 2026
cb1c2f2
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 20, 2026
e191b22
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 20, 2026
ea3ef0d
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 20, 2026
c303ae3
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jan 20, 2026
2a3acb9
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 20, 2026
4e207ba
- Added `Source` property to `IInputBinding`
tig Jan 20, 2026
a42d75e
- `MouseBindingTests.cs` - 14 tests covering constructor, propertie…
tig Jan 20, 2026
9fc5cfe
updated plans
tig Jan 20, 2026
261d5e1
Phase 2: New Types ✅ COMPLETED
tig Jan 20, 2026
8bcc8a5
- Created `InputBinding` record struct in `Terminal.Gui\Input\Input…
tig Jan 21, 2026
b4ec69b
udpated docs
tig Jan 21, 2026
128b843
udpated doc
tig Jan 21, 2026
613aef5
tweaked plans
tig Jan 21, 2026
d9cc8af
Added complex scenario to plan.
tig Jan 21, 2026
defb9c8
Added tests that prove current system is broken - they are currently …
tig Jan 21, 2026
6e132d5
updated plan
tig Jan 21, 2026
de06f3f
Add IValue<T> implementation plan document
tig Jan 21, 2026
095ea56
Add non-generic IValue interface
tig Jan 21, 2026
e24fb43
NumericUpDown implements IValue<T> with CWP events
tig Jan 21, 2026
430d0a8
Implement IValue on CheckBox, TextField, and SelectorBase
tig Jan 21, 2026
ba9341a
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 21, 2026
6c980de
Implement IValue<T> on remaining value-bearing Views
tig Jan 21, 2026
b7a2ec5
Merge v2_develop - resolve TextField.Text.cs conflict
tig Jan 21, 2026
15acf28
cleanup
tig Jan 21, 2026
793f13c
revised
tig Jan 21, 2026
3bc4ab8
1. CheckBox - Removed CheckedState, CheckedStateChanging, CheckedSta…
tig Jan 21, 2026
2d635e7
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 21, 2026
a0af108
Code cleanup
tig Jan 21, 2026
1d9b4fa
Merge v2_develop - resolve AnsiRequestsScenario.cs conflict
tig Jan 21, 2026
123a56b
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 21, 2026
fbcdbe0
Merge branch 'v2_develop' into feature/ivalue-interface-standardization
tig Jan 21, 2026
ed709f0
Merge branch 'feature/ivalue-interface-standardization' into copilot/…
tig Jan 21, 2026
82d4614
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 21, 2026
9dc5489
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 21, 2026
f835b7e
merged
tig Jan 21, 2026
957d6a3
Merge branch 'feature/ivalue-interface-standardization' of tig:tig/Te…
tig Jan 21, 2026
b77d1ea
fixed merge issues
tig Jan 21, 2026
0c41e21
Fixed regression
tig Jan 21, 2026
8eddd2e
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 21, 2026
aff1dd0
Merge branch 'v2_develop' into feature/ivalue-interface-standardization
tig Jan 21, 2026
36c38a0
Merge branch 'feature/ivalue-interface-standardization' of tig:tig/Te…
tig Jan 21, 2026
53492f9
Merge branch 'copilot/fix-command-propagation-issue' of https://githu…
tig Jan 21, 2026
2235569
merged
tig Jan 21, 2026
c191719
tweaks
tig Jan 21, 2026
b832d45
doc cleanup
tig Jan 21, 2026
45e2552
updated plan
tig Jan 21, 2026
96277c1
updated plan
tig Jan 21, 2026
8626313
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 22, 2026
51a716e
Code cleanup & reorg
tig Jan 22, 2026
f6ff80f
Phase 1: Add tests for PropagatedCommands functionality
tig Jan 22, 2026
b989482
Phase 2: WeakReference infrastructure for CommandContext.Source
tig Jan 22, 2026
30679ca
Merge branch 'gui-cs:v2_develop' into v2_develop
tig Jan 22, 2026
4eb8763
Add ShortcutTest example and tersify plan document
tig Jan 22, 2026
c107058
Merge branch 'v2_develop' into copilot/fix-command-propagation-issue
tig Jan 22, 2026
788aed4
Phase 3: Enable Command.Activate propagation for Shortcut hierarchy
tig Jan 22, 2026
d0fd023
Update plan: Phase 3 complete
tig Jan 22, 2026
ebc00dd
Merge branch 'copilot/fix-command-propagation-issue' of https://githu…
tig Jan 23, 2026
ebb93e6
Enforce formatting rules, add validation checklists
tig Jan 23, 2026
0a73b4f
deleted old file
tig Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions .claude/POST-GENERATION-VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# Post-Generation Validation Checklist

**USE THIS CHECKLIST AFTER GENERATING OR MODIFYING ANY CODE.**

This is a mandatory validation step. AI agents frequently make formatting and style errors that violate Terminal.Gui conventions. Scan every line of generated code before considering the task complete.

## Part 1: Formatting Violations (MOST CRITICAL)

These are the **most commonly violated rules**. Check EVERY line:

### Space Before Parentheses ⚠️ #1 MISTAKE
```csharp
// CORRECT ✓
void MyMethod ()
int result = Calculate (x, y);
var items = GetItems ();
if (condition)
using (var obj = Create ())

// WRONG ✗ - SCAN FOR THESE
void MyMethod() // Missing space before ()
int result = Calculate(x, y);
var items = GetItems();
if(condition)
using(var obj = Create())
```

**Scan pattern:** Look for `\w(` (word character followed immediately by `(`)

### Space Before Brackets ⚠️ #2 MISTAKE
```csharp
// CORRECT ✓
var value = array [index];
var item = list [0];
MyArray [i] = value;

// WRONG ✗ - SCAN FOR THESE
var value = array[index]; // Missing space before [
var item = list[0];
MyArray[i] = value;
```

**Scan pattern:** Look for `\w[` (word character followed immediately by `[`)

### Braces on Next Line ⚠️ #3 MISTAKE
```csharp
// CORRECT ✓
void MyMethod ()
{
if (condition)
{
DoWork ();
}
}

// WRONG ✗ - SCAN FOR THESE
void MyMethod() { // Brace on same line
void MyMethod () { // Brace on same line
if (condition) { // Brace on same line
DoWork();
}
}
```

**Scan pattern:** Look for `) {` or `= {` (brace on same line)

### Blank Lines ⚠️ #4 MISTAKE
```csharp
// CORRECT ✓ - blank line BEFORE control transfer
DoWork ();

return result; // Blank line above

// CORRECT ✓ - blank line AFTER control block
if (condition)
{
DoWork ();
}

DoNext (); // Blank line above

// WRONG ✗ - SCAN FOR THESE
DoWork ();
return result; // No blank line above return

if (condition) { DoWork (); }
DoNext (); // No blank line after control block
```

**Control transfer statements:** `return`, `break`, `continue`, `throw`
**Control blocks:** `if`, `for`, `while`, `foreach`, `using`, `try`/`catch`

### Indentation
```csharp
// CORRECT ✓ - 4 spaces per level
public class MyClass
{
public void MyMethod ()
{
if (condition)
{
DoWork ();
}
}
}

// WRONG ✗ - tabs or wrong spacing
public class MyClass
{
public void MyMethod () // Tab instead of spaces
{
if (condition) // 2 spaces instead of 4
{
```

**Rule:** 4 spaces per indentation level. NO tabs.

## Part 2: Code Style Violations

### No `var` for Non-Built-In Types
```csharp
// CORRECT ✓
Label label = new () { Text = "Hello" };
List<View> views = [];
Window window = new ();
var count = 0; // OK - int is built-in
var text = "hello"; // OK - string is built-in

// WRONG ✗
var label = new Label { Text = "Hello" };
var views = new List<View>();
var window = new Window();
```

**Built-in types where var is OK:** `int`, `string`, `bool`, `double`, `float`, `decimal`, `char`, `byte`

### Target-Typed New
```csharp
// CORRECT ✓
Label label = new () { Text = "Hello" };
Window window = new ();

// WRONG ✗
Label label = new Label() { Text = "Hello" };
Window window = new Window();
```

### Collection Expressions
```csharp
// CORRECT ✓
List<string> items = ["one", "two", "three"];
AllSuggestions = ["word1", "word2", "word3"];
return [];

// WRONG ✗
List<string> items = new () { "one", "two", "three" };
AllSuggestions = new () { "word1", "word2", "word3" };
return new List<string>();
```

### Lambda Parameter Discards
```csharp
// CORRECT ✓
textField.TextChanged += (_, _) => { /* ... */ };
button.Accepting += (_, args) => ProcessArgs (args);

// WRONG ✗ - unused parameters
textField.TextChanged += (sender, e) => { /* ... */ };
textField.TextChanged += (s, prev) => { /* ... */ };
```

### Terminology
```csharp
// CORRECT ✓ - containment relationship
View superView = new ();
View subView = new ();
superView.Add (subView); // subView.SuperView == superView

// WRONG ✗ - for containment
View parent = new (); // Should be: superView
View child = new (); // Should be: subView
parent.Add (child);

// Comments:
// Add the button as a SubView of the window
// The dialog's SuperView is the application

// WRONG ✗ - in comments
// Add the button as a child of the window
// The dialog's parent is the application
```

**Use SuperView/SubView for containment.** Parent/Child only for non-containment references (rare).

## Part 3: Quick Scan Commands

Use these bash commands to catch common violations:

```bash
# Missing space before ( - most common error
grep -nE '\w\(' YourFile.cs | grep -v '//'

# Missing space before [
grep -nE '\w\[' YourFile.cs | grep -v '//'

# Brace on same line
grep -n ') {' YourFile.cs
grep -n '= {' YourFile.cs

# Var usage (manually verify each is built-in type)
grep -n '\bvar\b' YourFile.cs

# Trailing whitespace
grep -n ' $' YourFile.cs
```

## Part 4: Manual Review

After automated checks, manually review:

1. **Every method call/declaration** - space before `()`?
2. **Every array access** - space before `[]`?
3. **Every opening brace** - on next line?
4. **Every return statement** - blank line before it?
5. **Every control block** - blank line after it?

## Validation Frequency

Use this checklist:
- ✅ After generating any new class or file
- ✅ After modifying existing methods (scan modified lines)
- ✅ After completing any task that involves code generation
- ✅ Before creating a commit or pull request
- ✅ When the code "looks wrong" visually

## Why This Matters

Formatting violations:
- Create noise in code reviews
- Violate project CI/CD checks
- Make code inconsistent with the rest of Terminal.Gui
- Are the #1 complaint about AI-generated code
- Are easily preventable with this checklist

**The space-before-parentheses style is unusual compared to most C# projects, making it the most commonly violated rule.**
8 changes: 7 additions & 1 deletion .claude/REFRESH.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
5. **Unused lambda params** - use `_` discard: `(_, _) => { }`
6. **Local functions** - use camelCase: `void myLocalFunc ()`
7. **Backing fields** - place immediately before their property (ReSharper bug, must do manually)
8. **ReShaper Formatting** - run ReSharper code cleanup with "Full Cleanup" profile (not the built-in one).
8. **SPACE BEFORE PARENTHESES** - `Method ()` not `Method()`, `array [i]` not `array[i]` (see `formatting.md`)
9. **Braces on next line** - ALL opening braces on next line (Allman style)
10. **Blank lines** - before `return`/`break`/`continue`/`throw`, after control blocks

## Before Each File Edit

Expand All @@ -21,10 +23,14 @@ Ask yourself:
- [ ] Am I using collection expressions []?
- [ ] Are my lambda parameters discards if unused?
- [ ] Am I using correct terminology (SubView, not child)?
- [ ] **Did I add space BEFORE parentheses and brackets?**
- [ ] **Are ALL braces on the next line?**
- [ ] **Did I add blank lines before returns and after control blocks?**

## If Unsure

Re-read the relevant rule file in `.claude/rules/`:
- `formatting.md` - **SPACING, BRACES, BLANK LINES** (most commonly violated!)
- `type-declarations.md` - var vs explicit types
- `target-typed-new.md` - new() syntax
- `terminology.md` - SubView/SuperView terms
Expand Down
Loading
Loading