fix: session deletion persistence and action button overlap

- Fix blacklist reconciliation logic that was removing blacklisted keys
  for sessions still on the gateway (inverted filter condition)
- Move message action buttons (copy, bookmark, metadata, retry) above
  the message bubble (-top-3) to prevent overlapping text content

Closes #73, #74
This commit is contained in:
Nicolas Varrot
2026-02-15 02:02:00 +00:00
parent e1a42afd8b
commit e1ba4aaf9d
3 changed files with 19 additions and 7 deletions

View File

@@ -130,14 +130,14 @@ export function useGateway() {
const sessionList = res?.sessions as Array<Record<string, unknown>> | undefined;
if (sessionList) {
const deleted = getDeletedSessions();
// Reconcile: remove blacklisted keys that still exist on the gateway
// (e.g. permanent sessions like agent:main:main that can't actually be deleted)
// Reconcile: remove blacklisted keys for sessions that no longer exist on the gateway
// (they were successfully deleted, so no need to keep hiding them)
const activeKeys = new Set(sessionList.map((s) => (s.key || s.sessionKey) as string));
const reconciled = new Set([...deleted].filter((k) => !activeKeys.has(k)));
const reconciled = new Set([...deleted].filter((k) => activeKeys.has(k)));
if (reconciled.size !== deleted.size) {
localStorage.setItem('pinchchat-deleted-sessions', JSON.stringify([...reconciled]));
}
setSessions(sessionList.filter((s) => !reconciled.has((s.key || s.sessionKey) as string)).map((s) => ({
setSessions(sessionList.filter((s) => !deleted.has((s.key || s.sessionKey) as string)).map((s) => ({
key: (s.key || s.sessionKey) as string,
label: (s.label || s.key || s.sessionKey) as string,
messageCount: s.messageCount as number | undefined,