fix: avoid repeated file token units#5
Merged
Conversation
Greptile SummaryThis PR removes the repeated
Confidence Score: 5/5Safe to merge — the change is a pure display formatting adjustment with no effect on search logic, pagination, or data handling. The diff touches only string formatting in two functions and their test coverage. Both branches of file_preview (with and without a meaningful first line) are now exercised by the new EmptyController.php fixture. No logic, data flow, or public API surface is altered. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[file_preview called] --> B{metadata readable?}
B -- No --> C[return None]
B -- Yes --> D[estimate_tokens from file size]
D --> E[first_meaningful_line]
E --> F{summary empty?}
F -- Yes --> G["return Some('~N')"]
F -- No --> H["return Some('~N · summary')"]
I[format_glob_result] --> J["header: '...N of M files (offset O, sizes ~= tokens)'"]
J --> K[append_grouped_files]
K --> L["per-file row: ' filename.ext (~N)' or ' filename.ext (~N · summary)'"]
Reviews (1): Last reviewed commit: "fix: avoid repeated file token units" | Re-trigger Greptile |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
tokensunit in each file glob result row.sizes ~= tokens.Validation
cargo fmt --checkcargo test --locked --test files_and_symbol_glob files_action_lists_file_globsRelease note
Parking this PR for a later public release batch. No version bump, publish, tag, or release is included here.