2026-03-02 09:07:09 -06:00
|
|
|
import * as React from "react";
|
|
|
|
|
import * as RouterDom from "react-router-dom";
|
|
|
|
|
import type { NavigateOptions, To } from "react-router-dom";
|
2026-04-11 11:05:32 -05:00
|
|
|
import type { Issue } from "@paperclipai/shared";
|
2026-03-02 09:07:09 -06:00
|
|
|
import { useCompany } from "@/context/CompanyContext";
|
2026-04-10 22:36:45 -05:00
|
|
|
import { IssueLinkQuicklook } from "@/components/IssueLinkQuicklook";
|
2026-03-02 09:07:09 -06:00
|
|
|
import {
|
|
|
|
|
applyCompanyPrefix,
|
|
|
|
|
extractCompanyPrefixFromPath,
|
|
|
|
|
normalizeCompanyPrefix,
|
|
|
|
|
} from "@/lib/company-routes";
|
Sync/master post pap1497 followups 2026 04 15 (#3779)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies
> - The board depends on issue, inbox, cost, and company-skill surfaces
to stay accurate and fast while agents are actively working
> - The PAP-1497 follow-up branch exposed a few rough edges in those
surfaces: stale active-run state on completed issues, missing creator
filters, oversized issue payload scans, and placeholder issue-route
parsing
> - Those gaps make the control plane harder to trust because operators
can see misleading run state, miss the right subset of work, or pay
extra query/render cost on large issue records
> - This pull request tightens those follow-ups across server and UI
code, and adds regression coverage for the affected paths
> - The benefit is a more reliable issue workflow, safer high-volume
cost aggregation, and clearer board/operator navigation
## What Changed
- Added the `v2026.415.0` release changelog entry.
- Fixed stale issue-run presentation after completion and reused the
shared issue-path parser so literal route placeholders no longer become
issue links.
- Added creator filters to the Issues page and Inbox, including
persisted filter-state normalization and regression coverage.
- Bounded issue detail/list project-mention scans and trimmed large
issue-list payload fields to keep issue reads lighter.
- Hardened company-skill list projection and cost/finance aggregation so
large markdown blobs and large summed values do not leak into list
responses or overflow 32-bit casts.
- Added targeted server/UI regression tests for company skills,
costs/finance, issue mention scanning, creator filters, inbox
normalization, and issue reference parsing.
## Verification
- `pnpm exec vitest run
server/src/__tests__/company-skills-service.test.ts
server/src/__tests__/costs-service.test.ts
server/src/__tests__/issues-goal-context-routes.test.ts
server/src/__tests__/issues-service.test.ts ui/src/lib/inbox.test.ts
ui/src/lib/issue-filters.test.ts ui/src/lib/issue-reference.test.ts`
- `gh pr checks 3779`
Current pass set on the PR head: `policy`, `verify`, `e2e`,
`security/snyk (cryppadotta)`, `Greptile Review`
## Risks
- Creator filter options are derived from the currently loaded
issue/agent data, so very sparse result sets may not surface every
historical creator until they appear in the active dataset.
- Cost/finance aggregate casts now use `double precision`; that removes
the current overflow risk, but future schema changes should keep
large-value aggregation behavior under review.
- Issue detail mention scanning now skips comment-body scans on the
detail route, so any consumer that relied on comment-only project
mentions there would need to fetch them separately.
## Model Used
- OpenAI Codex, GPT-5-based coding agent with terminal tool use and
local code execution in the Paperclip workspace. Exact internal model
ID/context-window exposure is not surfaced in this session.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-15 21:13:56 -05:00
|
|
|
import { parseIssuePathIdFromPath } from "@/lib/issue-reference";
|
2026-04-10 22:36:45 -05:00
|
|
|
|
2026-03-02 09:07:09 -06:00
|
|
|
function resolveTo(to: To, companyPrefix: string | null): To {
|
|
|
|
|
if (typeof to === "string") {
|
|
|
|
|
return applyCompanyPrefix(to, companyPrefix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (to.pathname && to.pathname.startsWith("/")) {
|
|
|
|
|
const pathname = applyCompanyPrefix(to.pathname, companyPrefix);
|
|
|
|
|
if (pathname !== to.pathname) {
|
|
|
|
|
return { ...to, pathname };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return to;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function useActiveCompanyPrefix(): string | null {
|
|
|
|
|
const { selectedCompany } = useCompany();
|
|
|
|
|
const params = RouterDom.useParams<{ companyPrefix?: string }>();
|
|
|
|
|
const location = RouterDom.useLocation();
|
|
|
|
|
|
|
|
|
|
if (params.companyPrefix) {
|
|
|
|
|
return normalizeCompanyPrefix(params.companyPrefix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const pathPrefix = extractCompanyPrefixFromPath(location.pathname);
|
|
|
|
|
if (pathPrefix) return pathPrefix;
|
|
|
|
|
|
|
|
|
|
return selectedCompany ? normalizeCompanyPrefix(selectedCompany.issuePrefix) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export * from "react-router-dom";
|
|
|
|
|
|
2026-04-10 22:36:45 -05:00
|
|
|
type CompanyLinkProps = React.ComponentProps<typeof RouterDom.Link> & {
|
|
|
|
|
disableIssueQuicklook?: boolean;
|
2026-04-11 11:05:32 -05:00
|
|
|
issuePrefetch?: Issue | null;
|
Add ordered sub-issue navigation (#5938)
## Thinking Path
> - Paperclip orchestrates AI-agent companies through company-scoped
issues, comments, and execution context.
> - The issue detail page is the board surface where operators and
agents inspect a task in its parent/child workflow.
> - Ordered sub-issues need a low-friction way to move through work
without returning to the parent list after every issue.
> - Existing issue detail navigation only covered sibling transitions
and did not continue into a parent issue's first ordered child.
> - This pull request adds ordered previous/next navigation for issue
detail views and extends it to continue from a parent or last sibling
into the first direct child.
> - The benefit is a smoother review/execution path through hierarchical
work while preserving hidden issue filtering and dependency-aware
ordering.
## What Changed
- Added `IssueSiblingNavigation` and route-state handling so issue
detail footers can link to previous/next ordered issues.
- Extended sub-issue ordering helpers to build navigation from siblings
plus direct children, including root-parent and
last-sibling-to-first-child cases.
- Added page, component, and library tests for ordered sibling
navigation, child fallback navigation, hidden issues, and link
rendering.
- Fixed the quicklook blur/click race Greptile found by deferring close
until after portaled link clicks can complete, with a regression test.
- Polished the navigation landmark label so it remains accurate when the
next target is a direct child rather than a sibling.
## Verification
- `pnpm exec vitest run src/components/IssueLinkQuicklook.test.tsx
src/lib/issue-detail-subissues.test.ts
src/components/IssueSiblingNavigation.test.tsx
src/pages/IssueDetail.test.tsx --config vitest.config.ts` from `ui/` -
31 tests passed.
- `pnpm --filter @paperclipai/ui typecheck` - passed.
- `git diff --check` - passed.
- GitHub PR checks on latest head `34046be2` - passed: Greptile Review,
verify, e2e, Canary Dry Run, policy, Snyk, and serialized server shards.
- Screenshots: not captured in this heartbeat; this PR is a draft and
the changed states are covered by focused component/page tests.
## Risks
- Low risk; this is a UI navigation addition with no database or API
contract changes.
- The main behavioral risk is navigation ordering drift if
`workflowSort` expectations change later.
- The IssueDetail navigation now waits for child issue loading, which
avoids stale child fallback links but can delay footer navigation
briefly while data loads.
> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected - check the roadmap
first. See `CONTRIBUTING.md`.
## Model Used
- OpenAI Codex, GPT-5 coding agent with repository tool use and shell
execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-13 15:43:51 -05:00
|
|
|
issueQuicklookSide?: React.ComponentProps<typeof IssueLinkQuicklook>["issueQuicklookSide"];
|
|
|
|
|
issueQuicklookAlign?: React.ComponentProps<typeof IssueLinkQuicklook>["issueQuicklookAlign"];
|
2026-04-10 22:36:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Link = React.forwardRef<HTMLAnchorElement, CompanyLinkProps>(
|
Add ordered sub-issue navigation (#5938)
## Thinking Path
> - Paperclip orchestrates AI-agent companies through company-scoped
issues, comments, and execution context.
> - The issue detail page is the board surface where operators and
agents inspect a task in its parent/child workflow.
> - Ordered sub-issues need a low-friction way to move through work
without returning to the parent list after every issue.
> - Existing issue detail navigation only covered sibling transitions
and did not continue into a parent issue's first ordered child.
> - This pull request adds ordered previous/next navigation for issue
detail views and extends it to continue from a parent or last sibling
into the first direct child.
> - The benefit is a smoother review/execution path through hierarchical
work while preserving hidden issue filtering and dependency-aware
ordering.
## What Changed
- Added `IssueSiblingNavigation` and route-state handling so issue
detail footers can link to previous/next ordered issues.
- Extended sub-issue ordering helpers to build navigation from siblings
plus direct children, including root-parent and
last-sibling-to-first-child cases.
- Added page, component, and library tests for ordered sibling
navigation, child fallback navigation, hidden issues, and link
rendering.
- Fixed the quicklook blur/click race Greptile found by deferring close
until after portaled link clicks can complete, with a regression test.
- Polished the navigation landmark label so it remains accurate when the
next target is a direct child rather than a sibling.
## Verification
- `pnpm exec vitest run src/components/IssueLinkQuicklook.test.tsx
src/lib/issue-detail-subissues.test.ts
src/components/IssueSiblingNavigation.test.tsx
src/pages/IssueDetail.test.tsx --config vitest.config.ts` from `ui/` -
31 tests passed.
- `pnpm --filter @paperclipai/ui typecheck` - passed.
- `git diff --check` - passed.
- GitHub PR checks on latest head `34046be2` - passed: Greptile Review,
verify, e2e, Canary Dry Run, policy, Snyk, and serialized server shards.
- Screenshots: not captured in this heartbeat; this PR is a draft and
the changed states are covered by focused component/page tests.
## Risks
- Low risk; this is a UI navigation addition with no database or API
contract changes.
- The main behavioral risk is navigation ordering drift if
`workflowSort` expectations change later.
- The IssueDetail navigation now waits for child issue loading, which
avoids stale child fallback links but can delay footer navigation
briefly while data loads.
> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected - check the roadmap
first. See `CONTRIBUTING.md`.
## Model Used
- OpenAI Codex, GPT-5 coding agent with repository tool use and shell
execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-13 15:43:51 -05:00
|
|
|
function CompanyLink({
|
|
|
|
|
to,
|
|
|
|
|
disableIssueQuicklook = false,
|
|
|
|
|
issuePrefetch = null,
|
|
|
|
|
issueQuicklookSide,
|
|
|
|
|
issueQuicklookAlign,
|
|
|
|
|
...props
|
|
|
|
|
}, ref) {
|
2026-03-02 09:07:09 -06:00
|
|
|
const companyPrefix = useActiveCompanyPrefix();
|
2026-04-10 22:36:45 -05:00
|
|
|
const resolvedTo = resolveTo(to, companyPrefix);
|
2026-04-12 21:30:50 -05:00
|
|
|
const issuePathId = parseIssuePathIdFromPath(typeof resolvedTo === "string" ? resolvedTo : resolvedTo.pathname);
|
2026-04-10 22:36:45 -05:00
|
|
|
|
|
|
|
|
if (issuePathId) {
|
2026-04-11 11:05:32 -05:00
|
|
|
return (
|
|
|
|
|
<IssueLinkQuicklook
|
|
|
|
|
ref={ref}
|
|
|
|
|
to={resolvedTo}
|
|
|
|
|
issuePathId={issuePathId}
|
|
|
|
|
disableIssueQuicklook={disableIssueQuicklook}
|
|
|
|
|
issuePrefetch={issuePrefetch}
|
Add ordered sub-issue navigation (#5938)
## Thinking Path
> - Paperclip orchestrates AI-agent companies through company-scoped
issues, comments, and execution context.
> - The issue detail page is the board surface where operators and
agents inspect a task in its parent/child workflow.
> - Ordered sub-issues need a low-friction way to move through work
without returning to the parent list after every issue.
> - Existing issue detail navigation only covered sibling transitions
and did not continue into a parent issue's first ordered child.
> - This pull request adds ordered previous/next navigation for issue
detail views and extends it to continue from a parent or last sibling
into the first direct child.
> - The benefit is a smoother review/execution path through hierarchical
work while preserving hidden issue filtering and dependency-aware
ordering.
## What Changed
- Added `IssueSiblingNavigation` and route-state handling so issue
detail footers can link to previous/next ordered issues.
- Extended sub-issue ordering helpers to build navigation from siblings
plus direct children, including root-parent and
last-sibling-to-first-child cases.
- Added page, component, and library tests for ordered sibling
navigation, child fallback navigation, hidden issues, and link
rendering.
- Fixed the quicklook blur/click race Greptile found by deferring close
until after portaled link clicks can complete, with a regression test.
- Polished the navigation landmark label so it remains accurate when the
next target is a direct child rather than a sibling.
## Verification
- `pnpm exec vitest run src/components/IssueLinkQuicklook.test.tsx
src/lib/issue-detail-subissues.test.ts
src/components/IssueSiblingNavigation.test.tsx
src/pages/IssueDetail.test.tsx --config vitest.config.ts` from `ui/` -
31 tests passed.
- `pnpm --filter @paperclipai/ui typecheck` - passed.
- `git diff --check` - passed.
- GitHub PR checks on latest head `34046be2` - passed: Greptile Review,
verify, e2e, Canary Dry Run, policy, Snyk, and serialized server shards.
- Screenshots: not captured in this heartbeat; this PR is a draft and
the changed states are covered by focused component/page tests.
## Risks
- Low risk; this is a UI navigation addition with no database or API
contract changes.
- The main behavioral risk is navigation ordering drift if
`workflowSort` expectations change later.
- The IssueDetail navigation now waits for child issue loading, which
avoids stale child fallback links but can delay footer navigation
briefly while data loads.
> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected - check the roadmap
first. See `CONTRIBUTING.md`.
## Model Used
- OpenAI Codex, GPT-5 coding agent with repository tool use and shell
execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-13 15:43:51 -05:00
|
|
|
issueQuicklookSide={issueQuicklookSide}
|
|
|
|
|
issueQuicklookAlign={issueQuicklookAlign}
|
2026-04-11 11:05:32 -05:00
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2026-04-10 22:36:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return <RouterDom.Link ref={ref} to={resolvedTo} {...props} />;
|
2026-03-02 09:07:09 -06:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const NavLink = React.forwardRef<HTMLAnchorElement, React.ComponentProps<typeof RouterDom.NavLink>>(
|
|
|
|
|
function CompanyNavLink({ to, ...props }, ref) {
|
|
|
|
|
const companyPrefix = useActiveCompanyPrefix();
|
|
|
|
|
return <RouterDom.NavLink ref={ref} to={resolveTo(to, companyPrefix)} {...props} />;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export function Navigate({ to, ...props }: React.ComponentProps<typeof RouterDom.Navigate>) {
|
|
|
|
|
const companyPrefix = useActiveCompanyPrefix();
|
|
|
|
|
return <RouterDom.Navigate to={resolveTo(to, companyPrefix)} {...props} />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function useNavigate(): ReturnType<typeof RouterDom.useNavigate> {
|
|
|
|
|
const navigate = RouterDom.useNavigate();
|
|
|
|
|
const companyPrefix = useActiveCompanyPrefix();
|
|
|
|
|
|
|
|
|
|
return React.useCallback(
|
|
|
|
|
((to: To | number, options?: NavigateOptions) => {
|
|
|
|
|
if (typeof to === "number") {
|
|
|
|
|
navigate(to);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
navigate(resolveTo(to, companyPrefix), options);
|
|
|
|
|
}) as ReturnType<typeof RouterDom.useNavigate>,
|
|
|
|
|
[navigate, companyPrefix],
|
|
|
|
|
);
|
|
|
|
|
}
|