| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: add TimestampLocator — pure timestamp lookup over ILogfileReader Ticket 1 of the Timestamp Locator extraction (candidate 6, docs/improve/logwindow-architecture-review.html). Ports LogWindow's four timestamp-lookup methods (binary search + forward/backward scan) into a Core module tested against a fake ITimestampSource — no WinForms type involved. Lands unused; LogWindow is migrated in the next commit. FindForward returns a tuple instead of using a ref int (closes the referenced-int shape of issue #404 for this seam), and positions the Columnizer callback on every line it inspects in both directions — the original forward scan never did, unlike its backward counterpart. 32 tests cover both scan directions, the binary search, the negated near-miss return on a search miss (including the -0/hit-at-line-zero ambiguity, preserved rather than "fixed" since it's inherent to the ported algorithm), and cancellation. | 3 个月前 | |
fix: FindLine returned a negated miss to callers that expect the nearest line Manual smoke on the Timestamp Locator extraction found "Scroll all tabs to current timestamp" and cross-window time-sync doing nothing at all. Root cause: a sign error in the port. The original FindTimestampLine ended with `return -foundLine` — the internal binary search reports a miss as the negated near-miss line, and the public method flipped it BACK to a positive, scrollable line number. The port misread that as "the negation is the public contract" and passed the negative through, so ScrollToTimestampWorker's `foundLine >= 0` check skipped scrolling on every inexact timestamp. Cross-window sync compares timestamps at millisecond precision (roundToSeconds: false), so an exact hit in a different file essentially never happens — every sync path was a no-op. FindLine now flips a miss to the positive converged line, matching the original exactly. FindNearestLine (used by TimeSpreadCalculator, which flips the sign itself) keeps the raw negated convention. The two mis-pinned tests now encode scroll-to-nearest with exact expected lines traced from the original algorithm, and CONTEXT.md's "Negated near-miss" entry now states which method carries which convention. | 3 个月前 |