20 lines · 536 B · TypeScript
RawDownload
export function resolveComposerMenuActiveItemId(input: {  items: ReadonlyArray<{ id: string }>;  highlightedItemId: string | null;  currentSearchKey: string | null;  highlightedSearchKey: string | null;}): string | null {  if (input.items.length === 0) {    return null;  }   if (    input.currentSearchKey === input.highlightedSearchKey &&    input.highlightedItemId &&    input.items.some((item) => item.id === input.highlightedItemId)  ) {    return input.highlightedItemId;  }   return input.items[0]?.id ?? null;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t