Skip to content

Conversation

@zoranjovo
Copy link

Addresses #292

Simply adds arrows next to each column name to sort all rows by that value asc or desc. Same as how the actual dynamodb web client can reorder rows just on the visible data currently displayed.

@rchl
Copy link
Collaborator

rchl commented Nov 2, 2025

I haven't tried it but given that it works on the client side, I assume it only takes into account items on the current page? That would likely not be good enough since user would expect that all the data is in sorted order and not only the current page.

@zoranjovo
Copy link
Author

Yep that's right, the user would need to set the page size to a high enough value to have all the data being shown to be able to sort it all. This is the same as how dynamodb > explore items on the aws console works. To have it rescan the entire table then sort would probably be beyond my knowledge.

Also I realised that on my version of macOS the Unicode arrows I chose don't render properly so I will fix that since I made this on a windows desktop.

}
.sortable-header {
cursor: pointer;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this should not use a pointer cursor since clicking this doesn't actually do anything. It should be on the arrows instead.

Comment on lines +434 to +435
<span class="sort-arrow sort-arrow-up" data-direction="asc" aria-label="Sort ascending" title="Sort ascending">↑</span>
<span class="sort-arrow sort-arrow-down" data-direction="desc" aria-label="Sort descending" title="Sort descending">↓</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

aria-label is not necessary when there is title.

tbody.append(rows)
}
function getCellValue(row, column) {
Copy link
Collaborator

@rchl rchl Nov 5, 2025

Choose a reason for hiding this comment

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

I don't like this relying on specific presentation details to get the items from the DOM (like extracting stuff from inside json-formatter-row-value elements and such). We have access to the original raw data - why won't we just sort those items and re-render the data using renderItems (or relevant code extracted from it)?

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.

2 participants