mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
Broaden comment matches in issue search
This commit is contained in:
parent
fcab770518
commit
1f78e55072
7 changed files with 267 additions and 26 deletions
|
|
@ -20,7 +20,7 @@ import {
|
|||
getApprovalsForTab,
|
||||
getInboxWorkItems,
|
||||
getInboxKeyboardSelectionIndex,
|
||||
getInboxSearchFallbackIssues,
|
||||
getInboxSearchSupplementIssues,
|
||||
getRecentTouchedIssues,
|
||||
getUnreadTouchedIssues,
|
||||
groupInboxWorkItems,
|
||||
|
|
@ -612,12 +612,12 @@ describe("inbox helpers", () => {
|
|||
).toEqual(["newer", "older"]);
|
||||
});
|
||||
|
||||
it("uses remote issue results only when local inbox search has no matches", () => {
|
||||
it("adds remote issue results that are not already present in inbox search results", () => {
|
||||
const remoteMatch = makeIssue("remote-match", false);
|
||||
remoteMatch.status = "in_progress";
|
||||
|
||||
expect(
|
||||
getInboxSearchFallbackIssues({
|
||||
getInboxSearchSupplementIssues({
|
||||
query: "pull/3303",
|
||||
filteredWorkItems: [],
|
||||
archivedSearchIssues: [],
|
||||
|
|
@ -635,9 +635,9 @@ describe("inbox helpers", () => {
|
|||
).toEqual(["remote-match"]);
|
||||
|
||||
expect(
|
||||
getInboxSearchFallbackIssues({
|
||||
getInboxSearchSupplementIssues({
|
||||
query: "pull/3303",
|
||||
filteredWorkItems: [{ kind: "issue", timestamp: 1, issue: makeIssue("local", false) }],
|
||||
filteredWorkItems: [{ kind: "issue", timestamp: 1, issue: makeIssue("remote-match", false) }],
|
||||
archivedSearchIssues: [],
|
||||
remoteIssues: [remoteMatch],
|
||||
issueFilters: {
|
||||
|
|
@ -653,10 +653,10 @@ describe("inbox helpers", () => {
|
|||
).toEqual([]);
|
||||
|
||||
expect(
|
||||
getInboxSearchFallbackIssues({
|
||||
getInboxSearchSupplementIssues({
|
||||
query: "pull/3303",
|
||||
filteredWorkItems: [],
|
||||
archivedSearchIssues: [makeIssue("archived", false)],
|
||||
archivedSearchIssues: [makeIssue("remote-match", false)],
|
||||
remoteIssues: [remoteMatch],
|
||||
issueFilters: {
|
||||
statuses: [],
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ export function getArchivedInboxSearchIssues({
|
|||
.sort(sortIssuesByMostRecentActivity);
|
||||
}
|
||||
|
||||
export function getInboxSearchFallbackIssues({
|
||||
export function getInboxSearchSupplementIssues({
|
||||
query,
|
||||
filteredWorkItems,
|
||||
archivedSearchIssues,
|
||||
|
|
@ -390,9 +390,14 @@ export function getInboxSearchFallbackIssues({
|
|||
}): Issue[] {
|
||||
const normalizedQuery = query.trim();
|
||||
if (!normalizedQuery) return [];
|
||||
if (filteredWorkItems.length > 0) return [];
|
||||
if (archivedSearchIssues.length > 0) return [];
|
||||
return applyIssueFilters(remoteIssues, issueFilters, currentUserId, enableRoutineVisibilityFilter);
|
||||
const visibleIssueIds = new Set([
|
||||
...filteredWorkItems
|
||||
.filter((item): item is Extract<InboxWorkItem, { kind: "issue" }> => item.kind === "issue")
|
||||
.map((item) => item.issue.id),
|
||||
...archivedSearchIssues.map((issue) => issue.id),
|
||||
]);
|
||||
return applyIssueFilters(remoteIssues, issueFilters, currentUserId, enableRoutineVisibilityFilter)
|
||||
.filter((issue) => !visibleIssueIds.has(issue.id));
|
||||
}
|
||||
|
||||
export function resolveIssueWorkspaceName(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue