Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions core/ui/modules/grid-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ export function goToPage(pageIndex) {
}

export function onColumnSort(columnName) {
if (state.sortedColumn === columnName) {
state.sortAscending = !state.sortAscending;
} else {
// Cycle through three states on repeated clicks of the same column:
// none (original order) -> ascending -> descending -> none ...
if (state.sortedColumn !== columnName) {
state.sortedColumn = columnName;
state.sortAscending = true;
} else if (state.sortAscending) {
state.sortAscending = false;
} else {
// Back to the original, unsorted order.
state.sortedColumn = null;
state.sortAscending = true;
}
loadTableData();
persistState();
Expand Down
2 changes: 1 addition & 1 deletion core/ui/modules/grid-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function createTableHeader(rowNumWidth, orderedColumns, pinnedColumnOffsets) {
th.innerHTML = `
<div class="header-content">
<div class="header-top">
${keyIcon}<span class="header-text">${safeColName}${sortIndicator}</span>
${keyIcon}<span class="header-text">${safeColName}</span>${sortIndicator}
<span class="select-column-icon codicon codicon-selection" title="Select entire column"></span>
<span class="pin-icon codicon codicon-pin ${pinClass}" title="${pinTitle}"></span>
</div>
Expand Down
5 changes: 3 additions & 2 deletions core/ui/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,12 @@ body {
min-width: 0;
}

/* Sort indicator - displayed inline next to column name */
/* Sort indicator - sits next to the column name as its own flex item so it is
never clipped by the name's text-overflow ellipsis on narrow columns */
.sort-indicator {
font-size: 10px;
margin-left: 4px;
color: var(--text-secondary);
flex-shrink: 0;
}

/* Primary key indicator - displayed before column name */
Expand Down
6 changes: 3 additions & 3 deletions core/ui/viewer.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions website/public/sqlite-viewer/viewer.html

Large diffs are not rendered by default.