unbridled-41 commented on PR #4901:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4901#issuecomment-5775354271
### Verification pass — clean checkout of `751fda34`
Re-verified from a fresh `git worktree add --detach
fork/fix/metrics-range-custom-panel`
(own checkout and build output; only `web/node_modules` symlinked).
#### One description defect found and corrected
The four citations in the description's table had been taken from a working
copy that carried
earlier local edits, so three of them did not point at the cited code on the
base commit (the
refresh button was quoted as `:1354-1357`, the instance switch as
`:878-880`, the history restore
as `:823-824`, the query-window popover as `:1189-1190`). They have been
re-read with `grep -n`
against both revisions and the table now gives *base commit* / *branch* for
every row:
| Site (`web/src/components/MetricsExplorer.tsx`) | Base `1ef5d860` | Branch
|
|-------------------------------------------------|-----------------|--------|
| `handleRangeChange` (the reported defect) | `:701-706` | `:766-776` |
| refresh button re-running both flows | `:1299-1303` | `:1303-1308` |
| instance switch (effect / re-run) | `:875-883`, re-run `:882` |
`:880-888`, re-run `:887` |
| deferred `activateDataSource` replay | `:852-854` | `:857-859` |
| query-window popover fed by `state.query.start/end` | `:1136-1137` |
`:1141-1142` |
The description also now states why the branch numbers are two lines lower:
the fix moves
`handleRangeChange` below `runCustomQuery` so the handler can call it.
#### Tests re-executed in the clean worktree
```
$ npx vitest run src/components/__tests__/MetricsExplorer.test.tsx
Test Files 1 passed (1)
Tests 30 passed (30)
$ npx vitest run src/components
Test Files 8 passed (8)
Tests 88 passed (88)
$ npx tsc -b && npx eslint src/components/MetricsExplorer.tsx
src/components/__tests__/MetricsExplorer.test.tsx
(no output, exit 0)
```
#### Pre-fix behaviour re-demonstrated
New test kept, only `web/src/components/MetricsExplorer.tsx` restored to
`origin/rocketmq-studio`:
```
× re-runs the committed custom query when the range changes
AssertionError: expected [ [ { …(4) } ] ] to have a length of 2 but got 1
Tests 1 failed | 29 skipped (30)
```
The assertion counts the calls carrying the custom expression
(`sum(rocketmq_topic_number)`) and
then checks the second one's window (`start 1799978400`, `step 2m`), so it
pins the re-run *and* the
window it uses.
#### Coverage note
Covered: the range control with a committed custom query. Not covered by
this PR (unchanged
behaviour, deliberately): the profile-panel load order and the history entry
a re-run appends.
No commit was needed for this PR: the correction was description-only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]