fix(api): server-side column filters for transactions (rant 2026-08-25T10:33:26) - #146
Merged
Conversation
…5T10:33:26) Column filters (type/user/model/key/pts/status) on the transactions page previously only filtered the currently loaded page locally, making results untrustworthy across thousands of rows (regression of PR #135 pagination). - backend: TxColFilters (model/user_name/key_name LIKE, status exact, pts_min/pts_max range) flattened into TxQuery/TxTrendQuery; tx_where() applies them joined to users/api_keys/keys; summary/total/trend all use the same filtered SQL; type whitelist now also accepts withdraw (the UI column filter offers it) - frontend: loadTransactions() sends filter params on list + trend requests; txFilterSig() guard reloads when filters change; renderTxSummary always uses the now filter-aware backend summary - test: transactions_column_filters (LIKE/exact/range/combined/trend) - cache-bust 20260824-14
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 25, 2026
argszero added a commit
that referenced
this pull request
Aug 25, 2026
…oses focus (rant 2026-08-25T11:15:16) (#148) Column-filter inputs on the transactions page lost focus after every keystroke (regression of PR #146 server-side filters, v0.7.18): the debounced filter change triggered an async fetch, and the fetch-return render rebuilt the whole table via innerHTML, destroying the focused input. Focus-restore ran after the wrong render. Fix (host-confirmed option B): the header filter row is now rendered once and survives rebuilds — buildDataTable only rebuilds tbody and the pager; the input DOM is never destroyed so focus is naturally preserved. - split thead (sort buttons + filter row) into tableTheadHtml, rendered only when the container has no <table> yet (values seeded from state.filters; afterwards the inputs are the DOM source of truth) - tbody (tableBodyHtml) and pager rebuilt on every render as before - per-render event binding replaced with one-time container-level delegation (sort / filter input / pager / page-size / IME), reading the latest config via container._dt so events survive rebuilds - IME composition tracked (compositionstart/end + focusout safety): no table rebuild / no setSelectionRange while composing, refresh debounced once after compositionend — Chinese IME input is not interrupted - focus restore only as fallback when the input is not focused - cache-bust 20260825-2 Co-authored-by: argszero <argszero@argszerodeMac-mini.local>
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 freeto 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
Fix the transactions-page column filters so they apply to the full dataset server-side instead of only the currently loaded page. This was a regression introduced by the backend pagination refactor (PR #135, v0.7.15): each page only loads
page_sizerows, so the localfilterRowsonly ever filtered those rows and the remaining thousands of records never entered the scope — filter results were untrustworthy.Related Issue
Rant
2026-08-25T10:33:26(verbatim):Changes
src/routes/wallet.rs):TxColFiltersstruct (model/user_name/key_nameLIKE,statusexact on DB values,pts_min/pts_maxrange), flattened intoTxQueryandTxTrendQuerytx_where()applies the column filters via LEFT JOINusers/api_keys/keys; summary, total, list and trend all use the same filtered SQL (consistent counts/summary across the whole set)withdraw(the UI column filter offers it; previously it would 400)ui/js/app.js):loadTransactions()serializestxTable.filtersinto both the list and trend requests (user_name/model/key_name/status/pts_min/pts_max; i18n labels reverse-mapped to English type keys / Chinese DB status values)txFilterSig()guard: a filter change now triggers a server reload (previously only page/pageSize changes did)renderTxSummary()always uses the backend summary, which is now filter-aware (local page-only summation removed from the login path)transactions_column_filters— LIKE (model/user_name/key_name), exact (status), range (pts_min/max), combined type+column filters, and trend consistency20260824-14Tests
cargo test— 147/147 passcargo fmt --check— cleancargo clippy— no new warningsnode --check ui/js/app.js— OKChecklist
fix/<description>main(default branch)