Bug
In Hermes Desktop, new sessions always appear at the bottom of the sidebar instead of at the top.
Expected behavior
When no manual sidebar ordering has been set by the user, sessions should use the natural recency order, with the newest / most recently active session at the top.
Actual behavior
On app startup, Desktop creates/persists localStorage["hermes.desktop.sessionOrder"] from the currently loaded session list.
After that, any newly created session ID is not in the persisted order list, so it gets appended to the bottom of the sidebar.
Clearing hermes.desktop.sessionOrder does not permanently fix it, because the app recreates the key on startup.
Reproduction steps
-
Open Hermes Desktop.
-
In DevTools Console, run:
localStorage.removeItem('hermes.desktop.sessionOrder')
location.reload()
-
After reload, check localStorage again:
localStorage.getItem('hermes.desktop.sessionOrder')
-
The key has been recreated even though the user did not manually reorder sessions.
-
Create a new session.
-
The new session appears at the bottom of the Sessions list instead of the top.
Suspected cause
This appears to come from:
function reconcileOrderIds(currentIds: string[], orderIds: string[]): string[] {
if (!currentIds.length) {
return []
}
if (!orderIds.length) {
return currentIds
}
When orderIds is empty/missing, returning currentIds causes the current natural order to be persisted as a manual order.
Then future unknown session IDs are appended after the persisted list.
Suggested fix
Do not seed a manual order when no manual order exists.
For example:
if (!orderIds.length) {
return []
}
or otherwise only persist hermes.desktop.sessionOrder after an actual drag/reorder action.
I tested this locally by changing that branch to return [], rebuilding Desktop, clearing hermes.desktop.sessionOrder once, and new sessions returned to appearing at the top.
Related commits
This likely started around:
3fc67b733 — Persist desktop sidebar drag order
694adec63 — Smooth desktop sidebar drag sorting
The specific auto-seeding behavior appears to come from 694adec63.
Bug
In Hermes Desktop, new sessions always appear at the bottom of the sidebar instead of at the top.
Expected behavior
When no manual sidebar ordering has been set by the user, sessions should use the natural recency order, with the newest / most recently active session at the top.
Actual behavior
On app startup, Desktop creates/persists
localStorage["hermes.desktop.sessionOrder"]from the currently loaded session list.After that, any newly created session ID is not in the persisted order list, so it gets appended to the bottom of the sidebar.
Clearing
hermes.desktop.sessionOrderdoes not permanently fix it, because the app recreates the key on startup.Reproduction steps
Open Hermes Desktop.
In DevTools Console, run:
After reload, check localStorage again:
The key has been recreated even though the user did not manually reorder sessions.
Create a new session.
The new session appears at the bottom of the Sessions list instead of the top.
Suspected cause
This appears to come from:
When
orderIdsis empty/missing, returningcurrentIdscauses the current natural order to be persisted as a manual order.Then future unknown session IDs are appended after the persisted list.
Suggested fix
Do not seed a manual order when no manual order exists.
For example:
or otherwise only persist
hermes.desktop.sessionOrderafter an actual drag/reorder action.I tested this locally by changing that branch to return
[], rebuilding Desktop, clearinghermes.desktop.sessionOrderonce, and new sessions returned to appearing at the top.Related commits
This likely started around:
3fc67b733—Persist desktop sidebar drag order694adec63—Smooth desktop sidebar drag sortingThe specific auto-seeding behavior appears to come from
694adec63.