( previous: FocusHistoryEntry[], node: Pick<FocusHistoryEntry, "id" | "name">, )
| 73 | } |
| 74 | |
| 75 | export function appendFocusHistory( |
| 76 | previous: FocusHistoryEntry[], |
| 77 | node: Pick<FocusHistoryEntry, "id" | "name">, |
| 78 | ): FocusHistoryEntry[] { |
| 79 | const trimmed = previous.filter((entry) => entry.id !== node.id); |
| 80 | return [...trimmed.slice(-7), { id: node.id, name: node.name }]; |
| 81 | } |