docs(comments): rewrite comments across all crates to the guidelines
Sweep every first-party crate source (1956 .rs files) to the project comment guidelines: delete redundant restatements, decorative banners, change narration, and end-of-line comments; keep and tighten the crucial ones (invariants, bug rationale, SAFETY blocks, ported-source attribution). No functional code changed. Every edit is proven comment-only against the prior tree by a comment-stripping lexer (string/char/raw-string aware) plus a separate doctest-fence check. Where removing a comment made rustfmt or clippy want to re-lay-out adjacent code, the minimal triggering comment is restored so code tokens stay byte-identical. Gates green: cargo fmt --all --check (0 diffs), cargo check and cargo clippy --workspace --all-targets (0 warnings). Adds scripts/check_codegen_comment_guidelines.py — the enforcement gate for these guidelines (flags banners, end-of-line comments, change narration, and commented-out code).
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
//! Shared prompt-area list overlay: accent bar, bold title, and a
|
||||
//! scrollable single-line row list with a cursor.
|
||||
//!
|
||||
//! One source of truth for the row geometry that `/rewind`'s picker phase
|
||||
//! and `/jump` previously each kept in sync by hand across their render,
|
||||
//! hit-test, and height functions. Row *content* stays with the caller
|
||||
//! (a closure); this owns chrome, cursor styling, and the scroll window.
|
||||
//! One source of truth for the row geometry shared by `/rewind`'s picker
|
||||
//! phase and `/jump` across their render, hit-test, and height paths. Row
|
||||
//! *content* stays with the caller (a closure); this owns chrome, cursor
|
||||
//! styling, and the scroll window.
|
||||
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::Rect;
|
||||
@@ -29,7 +29,6 @@ pub struct RowCtx {
|
||||
pub is_cursor: bool,
|
||||
/// Resolved row background (cursor rows get the visual-selection bg).
|
||||
pub row_bg: Color,
|
||||
/// Width available for the row's content.
|
||||
pub content_width: u16,
|
||||
}
|
||||
|
||||
@@ -210,12 +209,15 @@ mod tests {
|
||||
len: 2,
|
||||
selected: 0,
|
||||
};
|
||||
assert_eq!(two.height(40), 5); // title + 2 rows + padding
|
||||
// title + 2 rows + padding
|
||||
assert_eq!(two.height(40), 5);
|
||||
let many = ListOverlay {
|
||||
len: 30,
|
||||
selected: 0,
|
||||
};
|
||||
assert_eq!(many.height(40), 18); // 15-row cap
|
||||
assert_eq!(many.height(12), 8); // 60% screen cap
|
||||
// 15-row cap
|
||||
assert_eq!(many.height(40), 18);
|
||||
// 60% screen cap
|
||||
assert_eq!(many.height(12), 8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user