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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user