You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Update it whenever you learn something new about the project's patterns, convent
11
11
- Comment only to explain non-obvious reasoning or intent.
12
12
- Order functions high-level first, utilities last; order types by importance (public API first, private helpers last).
13
13
- Prefer directory submodules with `mod.rs` over sibling `foo.rs` submodule files when introducing new submodule trees.
14
+
- When splitting large modules, extract low-coupling impl blocks first and preserve existing external imports via local re-exports in the parent module.
14
15
15
16
## Rust
16
17
- Prefer `derive_more` traits (Debug, Deref) over manual implementations.
@@ -33,14 +34,17 @@ Update it whenever you learn something new about the project's patterns, convent
33
34
- For transient UI indicators (hover/focus highlights), derive visibility/target from current resolved state rather than only from enter/exit edge events.
34
35
- For context-specific behavior, prefer targeted follow-up evaluation over broad global rule changes that affect unrelated paths.
35
36
- When a generic pass applies fallback state, recompute context-specific state immediately afterward for impacted entities.
37
+
- For visual side effects derived from state transitions, prefer computing them in the centralized effects/update phase using previous/current state snapshots instead of duplicating eager updates across input and command paths.
36
38
- Keep invariant gating at a single layer where practical; avoid repeating identical mode/eligibility checks across caller and callee.
39
+
- When an operation must not emit follow-up commands, model it as `Result<()>` and enforce the invariant at the forwarding boundary.
37
40
- For internal invariant violations, prefer explicit panics over silent fallback/continue paths.
38
41
- When code guarantees an invariant, avoid defensive fallback branches for that path; keep the direct path and fail explicitly if the invariant is violated.
39
42
- For purely defensive invariant checks on hot paths, prefer debug-only assertions to avoid unnecessary release-build work.
40
43
- For platform-specific window commands, detect shortcuts where aggregated input state is available and keep the actual window mutation in the shell/window abstraction.
41
44
- When multiple transient affordances represent the same interaction mode, keep them behind one shared state instead of parallel flags.
42
45
- Cache repeated window state requests at the caller when the underlying platform mutation may hop to the main thread or otherwise be non-trivial.
43
46
- On macOS, prefer native menu selector wiring for commands that users can remap in App Shortcuts, instead of hardcoded key-chord matching.
47
+
- When refactoring eventful flows, extract pure target/decision helpers first and keep side-effect dispatch ordering unchanged until tests lock transition semantics.
0 commit comments