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
No actionable comments were generated in the recent review.
Walkthrough
The change adds Hick-Hyman decision-time and menu-clutter utilities. The module returns normalized choice counts, entropy, estimated decision time, clutter scores, severity levels, and recommendations. Tests cover input normalization, calculation results, severity thresholds, and menu evaluation.
Changes: Decision-Time and Clutter Model
Layer / File(s)
Summary
Decision calculation, menu evaluation, and tests src/lib/focus/hicks-law.ts, tests/hicks-law.test.ts
The module adds input and result types, normalization rules, decision-time and clutter calculations, severity guidance, and menu item evaluation. Tests cover boundary inputs, custom and invalid options, severity thresholds, score bounds, and menu recommendations.
This PR adds a self-contained decision-latency and clutter scoring utility with tests and does not alter existing behavior. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "feat(focus): add Hick-Hyman decision latency scorer" names the main change: a new Hick-Hyman decision-time and clutter scoring utility in src/lib/focus/hicks-law.ts, with tests. The raw sum…
Linked Issues check
Directly linked issue #808 requires a zero-dependency module at src/lib/focus/hicks-law.ts. The reviewed head contains that module. It exports ClutterSeverity, HickDecisionOptions, HickDecisionResult,…
Out of Scope Changes check
The whole-PR diff against merge base 0080f1d adds two files: src/lib/focus/hicks-law.ts (+132) and tests/hicks-law.test.ts (+90). Both files directly implement or test #808. No unrelated files, refac…
Full details: Title check
Explanation
The title "feat(focus): add Hick-Hyman decision latency scorer" names the main change: a new Hick-Hyman decision-time and clutter scoring utility in src/lib/focus/hicks-law.ts, with tests. The raw summary and objectives confirm this is the primary change, so the title is fully related to the changeset.
Full details: Linked Issues check
Explanation
Directly linked issue #808 requires a zero-dependency module at src/lib/focus/hicks-law.ts. The reviewed head contains that module. It exports ClutterSeverity, HickDecisionOptions, HickDecisionResult, calculateHickDecisionTime, and evaluateMenuClutter with the requested signatures. Verified in source: (1) Decision time uses a + b·log2(n+1)·f with defaults 200 ms, 150 ms, and 1.0. Familiarity is clamped to [0.5, 1.5]. (2) Negative, non-finite, and invalid inputs are normalized. Negative option counts become 0. For n = 0, entropy is 0 and decision time equals the base reaction time. (3) entropyBits is rounded to 3 decimals with Math.round(x*1000)/1000. (4) clutterScore uses min(100, round(log2(n+1)/log2(30)·100)) and is floored at 0, so it stays in [0, 100]. (5) Severity tiers are minimal at ≤4, moderate at 5–9, high at 10–19, and paralyzing at ≥20. (6) The module has no imports. The summary lists tests/hicks-law.test.ts with boundary, formula, configuration, and menu tests. I did not read the test file body. Test coverage is inferred from the summary and the file listing. The issue's verification commands are not coding requirements. The PR reports lint and a passing hicks-law test run; npx tsc --noEmit is not reported.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base 0080f1d adds two files: src/lib/focus/hicks-law.ts (+132) and tests/hicks-law.test.ts (+90). Both files directly implement or test #808. No unrelated files, refactors, or public declarations outside the requested API appear in the change summary. evaluateMenuClutter accepts the requested item shape but derives its result from items.length only. This follows the issue's menu-evaluation scope and is not an unrelated change. Its handling of isHighlighted and category is not specified in #808.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: c876ece4-4a95-47fb-9115-40beae575a3a
Commits
Reviewing files that changed from the base of the PR and between 0080f1d and fbd90ba.
Files selected for processing: 2
src/lib/focus/hicks-law.ts
tests/hicks-law.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
npm run lintnpm run typechecknode scratch/run-tests.mjs hicks-law(8 tests passed)Closes #808
Summary by CodeRabbit