Repository navigation
feat: add remaining balance and stream completion metrics to /streams/compare - #846
Merged
Jaydbrown merged 1 commit intoOct 22, 2026
Conversation
…/compare (conduit-protocol#783) Closes conduit-protocol#783 The comparison grid showed the schedule a stream runs on but not how far along it is, so managers comparing vesting streams had to work the numbers out themselves. Adds a projected completion timestamp to CompareMetrics: the moment the stream will have fully streamed if it carries on at the current rate from now. For a paused stream that lands later than the scheduled end by however long it has been paused, which is the number a manager actually needs. Ended, cancelled and open-ended streams have no projection. The grid gains three rows: - Completion - a static bar driven by the completion percentage. The existing StreamProgressBar animates each stream on its own schedule, so two bars in the same grid are not at the same visual state at the same moment; this one is directly comparable across columns. - Remaining balance - renames 'Left to stream' to the vocabulary the issue asks for. The value is unchanged. - Projected completion - the new timestamp, suffixed '(if resumed now)' for paused streams so the assumption is explicit. The completion bar follows the accessibility contract of StreamProgressBar (role=progressbar with aria-valuenow/min/max) and carries a distinct accessible name, so a screen reader does not announce the same value twice with no way to tell the two bars apart.
|
@AlphaMaleBaDI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Jaydbrown
approved these changes
Oct 22, 2026
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
Closes #783 —
app/streams/compare/page.tsx: add comparison metrics for remaining balance and stream completion percentage.The comparison grid showed the schedule a stream runs on, but not how far along it is. Comparing two vesting streams side-by-side meant working the numbers out by hand from the rate and the end date.
This adds the missing comparison metrics and a projected completion date, so the columns can be read directly against each other.
Changes
lib/stream-compare.tsCompareMetricsgainsprojectedEnd: number | null— the Unix timestamp at which the stream is projected to have fully streamed if it carries on at the current rate from now.activeandpausedstreams get a projection ofnow + remainingSecended,cancelledand open-ended streams getnull— there is nothing left to projectFor a paused stream the projection lands later than the scheduled end, by however long the stream has been paused. That is the number a manager needs, and it is not derivable from the existing
Endsrow.app/streams/compare/page.tsxThree rows change in the comparison grid:
CompletionLeft to stream→Remaining balanceProjected completion(if resumed now)for paused streams so the assumption is explicit.Completionexists as a separate bar becauseStreamProgressBaranimates each stream on its own schedule — two bars in the same grid are not at the same visual state at the same moment. The new bar is driven purely by the completion percentage, so the columns are directly comparable at a glance. The existing animatedProgressrow is left as it is.Accessibility
StreamProgressBaralready uses:role="progressbar"witharia-valuenow/aria-valuemin/aria-valuemax, so a screen reader announces it the same way whichever bar it reaches.Completion 50%against the animated bar's50% complete). Without that, a screen reader announces the same value twice with no way to tell the two bars apart.<th scope="row">with its<td>cells — the existing table semantics carry over unchanged, and the metric name is announced with its value.(if resumed now)suffix is inside the cell, so the assumption is part of the announced text rather than a visual-only annotation.Verification
Typecheck —
npx tsc --noEmitreports 0 errors in the three modified source files. The repo-wide total is unchanged frommain(7 errors, all pre-existing inapp/dashboard/page.tsx).Tests — targeted run:
lib/stream-compare.test.tscoversprojectedEndfor active (expected timestamp), paused (expected timestamp later than the scheduled end), ended, cancelled and open-ended (allnull). The existing compare page test still passes unchanged.Lint —
npx eslinton the three modified source files: clean, exit 0.Visual audit — the grid was rendered with mocked stream data and the resulting rows read:
Remaining balancepresent,Left to streamgoneProjected completionpresent;—for an ended stream, and(if resumed now)shown for a paused streamaria-valuenow="50", with the two bar types carrying distinct accessible namesNote —
mainis currently failing upstream CIThis PR is scoped to #783 and does not attempt to repair the baseline. For transparency,
mainis red before this change:app/dashboard/page.tsxcontains a duplicated JSX block (the tail of the date-range filter repeated after the volume-filter block, leaving an orphan</select>), which failstscand lintapp/create/page.tsxusesuseRefwithout importing it, which fails the test suitepackage-lock.jsonis out of sync withpackage.json, sonpm cifailsThe last five CI runs on
mainare all failing, andBuildis skipped because an earlier step fails. Those are separate defects and are deliberately left alone here — happy to open separate PRs for them if that would help.