Skip to content

Add clickable column sorting to the session list table - #8

Merged
4mGLn merged 3 commits into
mainfrom
feature/datagrid-column-sort
Oct 1, 2026
Merged

4mGLn merged 3 commits into
mainfrom
feature/datagrid-column-sort

Conversation

@4mGLn

@4mGLn 4mGLn commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • The List view's table (SESSION / STATUS / PROJECT / CREATED / ACTIVE / MSG / SIZE) had no way to reorder rows other than the server's fixed created_at DESC default.
  • Column headers are now pressable: click to sort by that column, click again to flip direction. The active column shows a ▲/▼ indicator.
  • Timeline view is untouched — it groups sessions by day rather than columns, so it keeps its own day/createdAt ordering regardless of this sort state.

Test plan

  • tsc --noEmit clean.
  • Full suite: 135/135 passing (no UI test harness exists for this RN-web plugin surface; verified manually below).
  • npm run build && npm run package:plugin, then paseo plugin reload sessionforge against a real local daemon — reloaded cleanly, logs show Plugin ready with no errors.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d101de3a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/sessions.tsx
) : (
<FlatList
data={visibleSessions}
data={sortedSessions}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use the displayed sort order for Shift-click ranges

After sorting any List column into an order that differs from the fetch order, renderItem supplies indexes from sortedSessions, but toggleSelected still slices activeViewSessionOrder, which returns the unsorted visibleSessions for List view. Thus Shift-clicking two displayed rows selects a different set of sessions than the visible range; subsequent bulk archive or delete can act on unintended sessions.

Useful? React with 👍 / 👎.

Comment thread client/sessions.tsx
Comment on lines +773 to +783
const sortedSessions = useMemo(() => {
const accessor = SORT_ACCESSOR[sort.column];
const factor = sort.direction === "asc" ? 1 : -1;
return [...visibleSessions].sort((a, b) => {
const left = accessor(a);
const right = accessor(b);
if (left < right) return -factor;
if (left > right) return factor;
return 0;
});
}, [visibleSessions, sort]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve FTS relevance ordering until users sort

When a search query is present, SessionStore.listSessions deliberately returns FTS results ordered by relevance (ORDER BY rank in packages/cli/src/core/store.server.ts:293-304), including title matches ahead of weaker body matches. This unconditional initial created descending sort replaces that ranking even before the user clicks a column, and the UI has no way to return to relevance order, so search results can put less relevant recent sessions ahead of stronger matches.

Useful? React with 👍 / 👎.

4mGLn and others added 2 commits October 1, 2026 14:40
The List view's table (SESSION/STATUS/PROJECT/CREATED/ACTIVE/MSG/SIZE)
had no way to reorder rows other than the server's fixed created_at
DESC default. Column headers are now pressable: click to sort by that
column, click again to flip direction, with an arrow indicator on the
active column. Timeline view is unaffected — it groups by day rather
than columns, so it keeps its own ordering.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Only the active sort column showed an icon, so the sort affordance
wasn't discoverable before clicking something. Every sortable header
now shows a muted neutral icon (⇅) by default, turning into a solid
directional arrow once active. Direction glyphs now follow the common
spreadsheet convention (ascending = ▼, descending = ▲), which was
backwards before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@4mGLn
4mGLn force-pushed the feature/datagrid-column-sort branch from 8d101de to d278972 Compare October 1, 2026 05:43
Mixing the double-line ⇅ (neutral) with solid ▲/▼ triangles (active)
made the icon visibly change style, not just direction, on click.
Switched to one glyph family throughout (↕ neutral, ↓/↑ active) and
added a gap between the column label and its icon, which previously
sat flush against each other.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@4mGLn
4mGLn merged commit 7d160cf into main Oct 1, 2026
4 checks passed
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.

1 participant