Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

fix: Table sorting#43

Merged
pyropy merged 4 commits intomainfrom
fix/table-sorting
Apr 15, 2025
Merged

fix: Table sorting#43
pyropy merged 4 commits intomainfrom
fix/table-sorting

Conversation

@pyropy
Copy link
Member

@pyropy pyropy commented Apr 8, 2025

This PR fixes sorting values inside dashboard tables. Fix is achieved by converting all sortable values to number and keeping as numerical values, formatting them inside of the Inputs.table element.

I have opted for Number instead of the BigInt for total value as we're using integers on the database level rather then big integers.

Closes #17

@pyropy pyropy requested a review from Copilot April 8, 2025 12:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/index.md:54

  • The 'total' field is converted to a BigInt, which may cause unexpected behavior when sorting or displaying the value if the table expects a Number. Consider converting to a Number or providing a formatting function that handles BigInt appropriately.
total: BigInt(record.total),

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 8, 2025

Deploying spark-dashboard with  Cloudflare Pages  Cloudflare Pages

Latest commit: 301dafd
Status: ✅  Deploy successful!
Preview URL: https://c1eb5d7a.spark-dashboard.pages.dev
Branch Preview URL: https://fix-table-sorting.spark-dashboard.pages.dev

View logs

@pyropy pyropy self-assigned this Apr 8, 2025
@pyropy pyropy marked this pull request as ready for review April 8, 2025 12:49
@pyropy
Copy link
Member Author

pyropy commented Apr 15, 2025

ping @NikolasHaimerl @juliangruber

Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it looks right, I trust this PR to be good 👍

@pyropy pyropy merged commit b75ae7f into main Apr 15, 2025
3 checks passed
@pyropy pyropy deleted the fix/table-sorting branch April 15, 2025 14:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Per-miner total & successful values are sorted as strings (not numbers)

3 participants