fix(web): link picker says when threads are on other environments #48301
Openchomamateusz(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/48301/headopened View on GitHubchomamateusz(GitHub profile, opens in a new tab) linked this to fix #47024
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -32,14 +35,10 @@3235 const projectNames = new Map(33- projects34- .filter((project) => project.environmentId === environmentId)35- .map((project) => [project.id, project.title]),36+ projects.map((project) => [37+ scopedProjectKey(scopeProjectRef(project.environmentId, project.id)),38+ project.title,39+ ]),3640 );41+ const projectName = (thread: ThreadShell) =>42+ projectNames.get(scopedProjectKey(scopeProjectRef(thread.environmentId, thread.projectId)));3743 const matches = threadLinkMatcher(query);38- const candidates = threads39- .filter(40- (thread) =>41- thread.environmentId === environmentId &&42- thread.archivedAt === null &&43- matches(`${thread.title} ${projectNames.get(thread.projectId) ?? ""}`),44- )45- .toSorted((a, b) => b.updatedAt.localeCompare(a.updatedAt));44+ const { candidates, matchesElsewhere } = threadLinkCandidates(threads, environmentId, (thread) =>@@ -38,15 +44,12 @@38- const candidates = threads39- .filter(40- (thread) =>41- thread.environmentId === environmentId &&42- thread.archivedAt === null &&43- matches(`${thread.title} ${projectNames.get(thread.projectId) ?? ""}`),44- )45- .toSorted((a, b) => b.updatedAt.localeCompare(a.updatedAt));44+ const { candidates, matchesElsewhere } = threadLinkCandidates(threads, environmentId, (thread) =>45+ matches(`${thread.title} ${projectName(thread) ?? ""}`),46+ );4647 return (4748 <Command mode="none" value={query} onValueChange={setQuery} aria-label={gt`Choose a thread`}>4849 <CommandInput placeholder={gt`Search threads or projects...`} disabled={pending} />4950 <CommandList className="max-h-80 overflow-y-auto">5051 {candidates.length === 0 ? (5152 <div className="px-3 py-6 text-center text-sm text-muted-foreground">52- <T>No active threads found.</T>53+ {matchesElsewhere ? (54+ <T>55+ No active threads on <Var>{environmentLabel}</Var>. Threads on other environments
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes