Repository navigation
Conversation
Resolving a range spec ("2.7,3.1", "ts-6,ts-12", "m-158") and a single
time value now live in their own methods, so commands other than "zoom
push" can accept the same syntax without changing the zoom.
"zoom push 3,2" committed an inverted range. Every query after it was empty, with a negative duration in the header and no explanation why. Fail with an explanation instead.
There was a problem hiding this comment.
🟡 Changes recommended
Marker ranges return before the ordering check in src/profile-query/index.ts, so an interval marker whose end precedes its start can still commit an inverted zoom, producing empty queries and a negative duration. Interval derivation preserves these endpoints unchanged, so a non-null end does not guarantee valid ordering.
1 open issue
What changed in this PR
Adds inverted-range rejection to profiler-cli zoom push through the shared profile-query layer.
Changes:
- Extracts time and range parsing for reuse by upcoming screenshot commands.
- Rejects reversed time pairs with a clear error.
- Adds a regression test for rejection without committing a range.
| File | Description |
|---|---|
src/test/unit/profile-query/profile-querier.test.ts |
Tests inverted-range rejection and unchanged empty zoom state. |
src/profile-query/index.ts |
Extracts parsing helpers and validates endpoint order. |
Review effort: Balanced
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.

Main | Deploy preview
Before this PR,
profiler-cli zoom push 3,2committed an inverted range. Every query after would come back empty, with a negative duration in the header and no explanation why. Now it fails withInvalid range "3,2": it ends before it starts. Put the earlier time first..The first commit moves the range and time value parsing out of
pushViewRangeinto_resolveRangeSpecand_resolveTimeValue. That keeps the check in one place, and lets the screenshot commands in the next PR take the same syntax aszoom push.