Skip to content

Sort Transaction List (ASC/DESC)#1219

Merged
munyanezaarmel merged 12 commits intomainfrom
ft-sort-transaction-list
Jan 27, 2026
Merged

Sort Transaction List (ASC/DESC)#1219
munyanezaarmel merged 12 commits intomainfrom
ft-sort-transaction-list

Conversation

@munyanezaarmel
Copy link
Copy Markdown
Contributor

Brief summary of the change made

Sort Transaction List
closes: #1118

Are there any other side effects of this change that we should be aware of?

The sorting is already implemented in the codebase, but it’s not working in components like AgentTransactionList and others because they use the old/manual table structure with and explicit loops. Vue Material’s sorting only works with v-model binding and scoped slots, so we need to migrate to the v-model approach.

Describe how you tested your changes?

Pull Request checklist

Please confirm you have completed any of the necessary steps below.

  • Meaningful Pull Request title and description
  • Changes tested as described above
  • Added appropriate documentation for the change.
  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

@dmohns, This is ready for review

@dmohns
Copy link
Copy Markdown
Member

dmohns commented Jan 14, 2026

Hey @munyanezaarmel

this has the same issue like: #1206 (review)

Screen.Recording.2026-01-14.at.15.42.34.mov
  1. The arrows are missing from the table header
  2. The call to the backend doesn't give a ASC/DESC

@dmohns
Copy link
Copy Markdown
Member

dmohns commented Jan 21, 2026

Hey @munyanezaarmel any chance to add the changes from user list sorting to this PR as well?

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@beesaferoot
Copy link
Copy Markdown
Contributor

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@munyanezaarmel Good catch. I don't think sorting was added to that endpoint. I will be looking into that.

@beesaferoot
Copy link
Copy Markdown
Contributor

beesaferoot commented Jan 21, 2026

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@munyanezaarmel Good catch. I don't think sorting was added to that endpoint. I will be looking into that.

Please check again, the endpoint now handles sort_by correctly. @munyanezaarmel

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@munyanezaarmel Good catch. I don't think sorting was added to that endpoint. I will be looking into that.

Please check again, the endpoint now handles sort_by correctly. @munyanezaarmel

Hey @beesaferoot ! The sorting still isn't working. When I click to sort by amount (or any column), the table still shows empty results.
The frontend is sending sort_by=-amount in the request, but the response comes back empty or unsorted.
Can you test the /api/transactions/advanced endpoint directly with these parameters to see what's happening?
per_page=15
status=1
provider=agent_transaction
sort_by=-amount
It should return sorted results but it's not working on my end.

@beesaferoot
Copy link
Copy Markdown
Contributor

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@munyanezaarmel Good catch. I don't think sorting was added to that endpoint. I will be looking into that.

Please check again, the endpoint now handles sort_by correctly. @munyanezaarmel

Hey @beesaferoot ! The sorting still isn't working. When I click to sort by amount (or any column), the table still shows empty results. The frontend is sending sort_by=-amount in the request, but the response comes back empty or unsorted. Can you test the /api/transactions/advanced endpoint directly with these parameters to see what's happening? per_page=15 status=1 provider=agent_transaction sort_by=-amount It should return sorted results but it's not working on my end.

You can see a test on Bruno calling the endpoint below.
Screenshot 2026-01-21 at 4 20 30 PM

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

Hey @beesaferoot! There's an issue with transaction sorting. When users click to sort the table:

  • The frontend sends a sort_by parameter (like sort_by=-created_at)
  • If there are any active filters, it calls /api/transactions/advanced
  • That endpoint returns empty results or ignores the sorting
    The simple /api/transactions/list/all endpoint works fine with sorting, but /api/transactions/advanced doesn't seem to respect the sort_by parameter.
    Can you check the advanced endpoint to make sure it's handling sort_by correctly?

@munyanezaarmel Good catch. I don't think sorting was added to that endpoint. I will be looking into that.

Please check again, the endpoint now handles sort_by correctly. @munyanezaarmel

Hey @beesaferoot ! The sorting still isn't working. When I click to sort by amount (or any column), the table still shows empty results. The frontend is sending sort_by=-amount in the request, but the response comes back empty or unsorted. Can you test the /api/transactions/advanced endpoint directly with these parameters to see what's happening? per_page=15 status=1 provider=agent_transaction sort_by=-amount It should return sorted results but it's not working on my end.

You can see a test on Bruno calling the endpoint below. Screenshot 2026-01-21 at 4 20 30 PM

Check let me know if it is working

@beesaferoot
Copy link
Copy Markdown
Contributor

Check let me know if it is working

Trying to test by selecting different sort fields (i.e clicking up and down arrows), it shows from the endpoint calls the frontend is doing something wrong here.

Screenshot 2026-01-21 at 8 24 07 PM

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

Trying to test by selecting different sort fields (i.e clicking up and down arrows), it shows from the endpoint calls the frontend is doing something wrong here.

The issue here is multiple duplicate requests

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

Check let me know if it is working

Trying to test by selecting different sort fields (i.e clicking up and down arrows), it shows from the endpoint calls the frontend is doing something wrong here.

Screenshot 2026-01-21 at 8 24 07 PM

Check again

@beesaferoot
Copy link
Copy Markdown
Contributor

@munyanezaarmel Can you inspect the requests as well? I can still see that all the requests use sort_by=-<sortkey> and also have odd behavior of calling a default sort request when I click on a different sort field.

Screenshot 2026-01-22 at 9 38 08 AM

Comment thread src/frontend/src/modules/Transactions/Transactions.vue Outdated
@beesaferoot
Copy link
Copy Markdown
Contributor

The sorting now works as expected. Please update your branch and address the last comment, thanks.

@beesaferoot beesaferoot self-requested a review January 23, 2026 20:51
@beesaferoot
Copy link
Copy Markdown
Contributor

@dmohns Can you also review this?

Copy link
Copy Markdown
Member

@dmohns dmohns left a comment

Choose a reason for hiding this comment

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

Looks good. Only thing I noticed is, that the ordering by type doesn't seem to work. Both orders show "energy" first.

image image

But in one of them "deferred" should be shown first. But I think it's unrelated to what is done in this PR.

@munyanezaarmel
Copy link
Copy Markdown
Contributor Author

@beesaferoot do we have "sort by type" on the backend ?

@beesaferoot
Copy link
Copy Markdown
Contributor

@beesaferoot do we have "sort by type" on the backend ?

Not really, but I don't think that is what's wrong here. The frontend is using original_transaction_type as the sort key instead of type.

You can simple add this, I will update the backend to accept type as a sort for transaction endpoint.

@munyanezaarmel munyanezaarmel merged commit aa9ea45 into main Jan 27, 2026
16 checks passed
@munyanezaarmel munyanezaarmel deleted the ft-sort-transaction-list branch January 27, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Sort Transaction List (ASC/DESC)

3 participants