Skip to content

Add command palette search for tickets, members, and theme.#193

Merged
mfisher31 merged 3 commits into
mainfrom
ui-feature
May 21, 2026
Merged

Add command palette search for tickets, members, and theme.#193
mfisher31 merged 3 commits into
mainfrom
ui-feature

Conversation

@SarkarShubhdeep
Copy link
Copy Markdown
Collaborator

Extend Cmd+K with ticket/member lookup, Shift+Enter to open DMs, theme commands, and fix MessagesPage so pending DM intent is not overridden by the default channel view.

Screen.Recording.2026-05-19.at.10.15.27.AM.mov

Extend Cmd+K with ticket/member lookup, Shift+Enter to open DMs, theme commands, and fix MessagesPage so pending DM intent is not overridden by the default channel view.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the global Cmd+K command palette with additional commands (ticket/member search, theme switching, and a DM shortcut) and updates MessagesPage deep-link/pending-thread handling to avoid DM intent being overridden by default channel selection.

Changes:

  • Add command palette groups for Theme, Tickets, and Team Members, plus Shift+Enter to open a DM thread with the highlighted member.
  • Fetch team tickets/members when the command palette opens to power in-palette search.
  • Add a pendingDmIntentRef guard in MessagesPage to prevent default channel view from overriding an intended DM view.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/ui/CommandPalette.tsx Adds theme commands, ticket/member search items, and Shift+Enter DM open behavior.
src/features/messages/MessagesPage.tsx Introduces a ref flag to preserve DM intent during initial channel/default selection.
Comments suppressed due to low confidence (1)

src/ui/CommandPalette.tsx:202

  • Same pattern as tickets: getMembers is kicked off on open without any cancellation/ignore in cleanup, so a late response can call setMembers after the palette closes or team changes. Add abort/ignore handling to avoid setting state from stale requests.
    ticketApi
      .getTickets(selectedTeamId)
      .then(setTickets)
      .catch(() => setTickets([]));
  }, [open, selectedTeamId]);

  useEffect(() => {
    if (!open || !selectedTeamId) {
      setMembers([]);

Comment thread src/ui/CommandPalette.tsx
Comment on lines 292 to +306
);

const openMessageToMember = useCallback(
(targetId: string) => {
if (!selectedTeamId || !user?.id || !selectedTeam) return;

const targetIsAdmin = selectedTeam.admins.includes(targetId);
const currentUserIsAdmin = selectedTeam.admins.includes(user.id);

let adminId: string;
let memberId: string;

if (currentUserIsAdmin && !targetIsAdmin) {
adminId = user.id;
memberId = targetId;
Comment thread src/ui/CommandPalette.tsx
Comment on lines 183 to +191
useEffect(() => {
if (!open) {
resetState();
}
}, [open, resetState]);

useEffect(() => {
if (!open || !selectedTeamId) {
setTickets([]);
Comment on lines +136 to +140
pendingDmIntentRef.current = false;
} else if (selectedTeam.members.includes(userId) && selectedTeam.admins.includes(peer)) {
setSelectedAdminId(peer);
setActiveView('dm');
pendingDmIntentRef.current = false;
Comment on lines 218 to 226
.then((cs) => {
setChannels(cs);
const def = cs.find((c) => c.isDefault) ?? cs[0];
if (def) {
setSelectedChannelId(def.id);
setActiveView('channel');
if (!pendingDmIntentRef.current) {
setActiveView('channel');
}
} else {
Comment on lines 170 to 181
const handler = (e: Event) => {
const {
teamId: tId,
adminId: aId,
memberId: mId,
} = (e as CustomEvent<{ teamId: string; adminId: string; memberId: string }>).detail;
if (tId) setSelectedTeamId(tId);
if (aId && mId && userId) {
pendingDmIntentRef.current = true;
if (userId === aId) setSelectedMemberId(mId);
else if (userId === mId) setSelectedAdminId(aId);
setActiveView('dm');
Restores the icon import dropped during conflict resolution so the Org Chart nav item compiles again.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown
Collaborator

@mfisher31 mfisher31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled, checked, works! Thanks @SarkarShubhdeep

@mfisher31 mfisher31 merged commit 9b925aa into main May 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants