mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
Address Greptile navigation review
This commit is contained in:
parent
0cb42f49ea
commit
6844226572
3 changed files with 9 additions and 6 deletions
|
|
@ -5,7 +5,12 @@ import type { Issue } from "@paperclipai/shared";
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { timeAgo } from "@/lib/timeAgo";
|
import { timeAgo } from "@/lib/timeAgo";
|
||||||
import { createIssueDetailPath, withIssueDetailHeaderSeed } from "@/lib/issueDetailBreadcrumb";
|
import { createIssueDetailPath, withIssueDetailHeaderSeed } from "@/lib/issueDetailBreadcrumb";
|
||||||
import { fetchIssueDetail, getCachedIssueDetail, prefetchIssueDetail } from "@/lib/issueDetailCache";
|
import {
|
||||||
|
fetchIssueDetail,
|
||||||
|
getCachedIssueDetail,
|
||||||
|
ISSUE_DETAIL_STALE_TIME_MS,
|
||||||
|
prefetchIssueDetail,
|
||||||
|
} from "@/lib/issueDetailCache";
|
||||||
import { queryKeys } from "@/lib/queryKeys";
|
import { queryKeys } from "@/lib/queryKeys";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||||
|
|
@ -99,7 +104,7 @@ export const IssueLinkQuicklook = React.forwardRef<
|
||||||
queryFn: () => fetchIssueDetail(queryClient, issuePathId),
|
queryFn: () => fetchIssueDetail(queryClient, issuePathId),
|
||||||
enabled: open,
|
enabled: open,
|
||||||
initialData: () => cachedIssue,
|
initialData: () => cachedIssue,
|
||||||
staleTime: 60_000,
|
staleTime: ISSUE_DETAIL_STALE_TIME_MS,
|
||||||
});
|
});
|
||||||
|
|
||||||
const detailPath = createIssueDetailPath(issuePathId);
|
const detailPath = createIssueDetailPath(issuePathId);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { issuesApi } from "@/api/issues";
|
||||||
import { queryKeys } from "@/lib/queryKeys";
|
import { queryKeys } from "@/lib/queryKeys";
|
||||||
|
|
||||||
const ISSUE_DETAIL_QUERY_PREFIX = ["issues", "detail"] as const;
|
const ISSUE_DETAIL_QUERY_PREFIX = ["issues", "detail"] as const;
|
||||||
const ISSUE_DETAIL_STALE_TIME_MS = 60_000;
|
export const ISSUE_DETAIL_STALE_TIME_MS = 60_000;
|
||||||
|
|
||||||
function isNonEmptyString(value: unknown): value is string {
|
function isNonEmptyString(value: unknown): value is string {
|
||||||
return typeof value === "string" && value.length > 0;
|
return typeof value === "string" && value.length > 0;
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, CompanyLinkProps>(
|
||||||
function CompanyLink({ to, disableIssueQuicklook = false, issuePrefetch = null, ...props }, ref) {
|
function CompanyLink({ to, disableIssueQuicklook = false, issuePrefetch = null, ...props }, ref) {
|
||||||
const companyPrefix = useActiveCompanyPrefix();
|
const companyPrefix = useActiveCompanyPrefix();
|
||||||
const resolvedTo = resolveTo(to, companyPrefix);
|
const resolvedTo = resolveTo(to, companyPrefix);
|
||||||
const issuePathId = disableIssueQuicklook
|
const issuePathId = parseIssuePathIdFromPath(typeof resolvedTo === "string" ? resolvedTo : resolvedTo.pathname);
|
||||||
? parseIssuePathIdFromPath(typeof resolvedTo === "string" ? resolvedTo : resolvedTo.pathname)
|
|
||||||
: parseIssuePathIdFromPath(typeof resolvedTo === "string" ? resolvedTo : resolvedTo.pathname);
|
|
||||||
|
|
||||||
if (issuePathId) {
|
if (issuePathId) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue