8000 feat(review): retry failed reviews and load source previews on demand by redoh · Pull Request #13 · inkspect-code-review/inkspect-ui · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,28 @@ as appropriate. The package's `0.1.0` version is not a claim of a tagged release
- Remove macOS Finder metadata from the repository and ignore future copies.
- Remove the Inkspect Microsoft publisher-domain association from self-hosted deployments.

#### Changed

- Show when the selected repository index is behind its default branch.

- Confirm and retry a failed or cancelled review directly from its pull request details.

- Label the initial action “Auto Fix” and the retry action “Retry Auto Fix” on a pull request review.

- Show the repository’s effective indexing size limit when indexing requires assistance.

#### Fixed

- Offer Retry review for a failed pull request review that used the server-selected model.

- Load cited code snippets only when a reader opens a source in Ask AI.

### 2026-11-22

#### Added

- Allow dashboard integrations to supply a usage summary for a finished review.

- Link dashboard metric cards to reviews, open findings and repositories.

- Add account email preferences, device management, profile editing and invitation actions. Move Usage to the account menu.
Expand Down
4 changes: 2 additions & 2 deletions src/components/chat-sources.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 6px 9px; border: 1px solid var(--dash-border); border-radius: 6px; background: var(--dash-panel); color: var(--dash-muted); font: inherit; font-size: 12px; cursor: pointer; }
.tab svg, .fileHeader svg { flex-shrink: 0; }
.tab:hover { color: var(--dash-text); border-color: var(--dash-muted); }
.tab[aria-selected="true"] { color: var(--dash-accent); border-color: color-mix(in srgb, var(--dash-accent) 50%, var(--dash-border)); background: color-mix(in srgb, var(--dash-accent) 9%, var(--dash-panel)); }
.tab[aria-expanded="true"] { color: var(--dash-accent); border-color: color-mix(in srgb, var(--dash-accent) 50%, var(--dash-border)); background: color-mix(in srgb, var(--dash-accent) 9%, var(--dash-panel)); }
.filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabReference { flex-shrink: 0; font-size: 10px; }
.filePanel { min-width: 0; border: 1px solid var(--dash-border); border-radius: 8px; overflow: hidden; background: var(--dash-panel); }
Expand All @@ -16,7 +16,7 @@
.codeViewport { height: 220px; min-width: 0; overflow: hidden; }
.codeViewport .code { height: 100%; max-height: none; box-sizing: border-box; }
.filePanel .toolbar { min-height: 38px; box-sizing: border-box; }
.fileSources :is(button, [role="tabpanel"], pre, a):focus-visible { outline: 2px solid var(--dash-accent); outline-offset: -2px; }
.fileSources :is(button, [role="region"], pre, a):focus-visible { outline: 2px solid var(--dash-accent); outline-offset: -2px; }
@media (max-width: 480px) {
.fileHeader { gap: 6px; padding-inline: 8px; }
.fileLocation { flex-direction: column; align-items: flex-end; gap: 2px; }
Expand Down
15 changes: 7 additions & 8 deletions src/components/chat-sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export function ChatSources({ sources, ...scope }: Scope & { sources: ChatRefere

function FileSources({ sources, ...scope }: Scope & { sources: Citation[] }) {
const id = useId();
const [selectedId, setSelectedId] = useState(sources[0].id);
const selected = sources.find(source => source.id === selectedId) ?? sources[0];
const [selectedId, setSelectedId] = useState<string | null>(null);
const selected = sources.find(source => source.id === selectedId);
function navigate(event: KeyboardEvent<HTMLButtonElement>, index: number) {
let next: number;
if (event.key === "ArrowRight") next = (index + 1) % sources.length;
Expand All @@ -36,24 +36,23 @@ function FileSources({ sources, ...scope }: Scope & { sources: Citation[] }) {
else if (event.key === "End") next = sources.length - 1;
else return;
event.preventDefault();
setSelectedId(sources[next].id);
event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>('[role="tab"]')[next]?.focus();
event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>('button')[next]?.focus();
}
return <div className={styles.fileSources}>
<div className={styles.tabs} role="tablist" aria-label="Source files">
<div className={styles.tabs} role="group" aria-label="Source files">
{sources.map((source, index) => {
const filename = source.path.split("/").pop() || source.path;
const duplicate = sources.some(other => other.id !== source.id && other.path.split("/").pop() === filename);
const label = `${source.id}: ${source.repository}/${source.path}, lines ${source.startLine}–${source.endLine}`;
return <button key={source.id} type="button" role="tab" id={`${id}-tab-${source.id}`} aria-controls={`${id}-panel`} aria-selected={source.id === selected.id} aria-label={label} title={label} tabIndex={source.id === selected.id ? 0 : -1} className={styles.tab} => setSelectedId(source.id)} => navigate(event, index)}>
return <button key={source.id} type="button" id={`${id}-source-${source.id}`} aria-controls={selectedId === source.id ? `${id}-panel` : undefined} aria-expanded={source.id === selectedId} aria-label={label} title={label} className={styles.tab} => setSelectedId(current => current === source.id ? null : source.id)} => navigate(event, index)}>
<FileText size={14} aria-hidden="true" /><span className={styles.filename}>{filename}</span>{duplicate && <span className={styles.tabReference}>{source.id} · {source.startLine}–{source.endLine}</span>}
</button>;
})}
</div>
<div className={styles.filePanel} role="tabpanel" id={`${id}-panel`} aria-labelledby={`${id}-tab-${selected.id}`} tabIndex={0}>
{selected && <div className={styles.filePanel} role="region" id={`${id}-panel`} aria-labelledby={`${id}-source-${selected.id}`} tabIndex={0}>
<div className={styles.fileHeader}><FileText size={14} aria-hidden="true" /><span className={styles.filePath} title={`${selected.repository}/${selected.path}`}>{selected.path}<small>{selected.repository}</small></span><span className={styles.fileLocation}><span className={styles.badge}>{selected.id}</span>Lines {selected.startLine}–{selected.endLine}</span></div>
<SourcePreview key={`${selected.id}:${selected.repository}:${selected.path}:${selected.revision}:${selected.startLine}:${selected.endLine}`} source={selected} {...scope} />
</div>
</div>}
</div>;
}

Expand Down
1 change: 1 addition & 0 deletions src/components/dashboard-edition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const DashboardEditionProvider = EditionContext.Provider;
export function useDashboardEdition() { return useContext(EditionContext); }

const WidgetsContext = createContext<{
ReviewUsage?: ComponentType<{ organizationId: string; jobId: string }>;
ReviewAllowance?: ComponentType<{ organizationId: string }>;
PublicRepositoryNotice?: ComponentType<{ repositoryId: string }>;
navigationIcons?: Partial<Record<DashboardSection, ReactNode>>;
Expand Down
6 changes: 3 additions & 3 deletions src/components/repositories-workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function RepositoryDetail({ organizationId, repository, onError }: { organizatio
const [index, setIndex] = useState<RepositoryIndex | null>(null);
const [eligibility, setEligibility] = useState<RepositoryIndexEligibility | null>(null);
const [loaded, setLoaded] = useState(false);
const [freshness, setFreshness] = useState<RepositoryIndexFreshness | null>(null);
const [freshness, setFreshness] = useState<(RepositoryIndexFreshness & { scheduled_at?: string }) | null>(null);
const [pending, setPending] = useState(false);
const [error, setError] = useState("");
const [live, setLive] = useState<LiveState>("connecting");
Expand Down Expand Up @@ -213,8 +213,8 @@ function RepositoryDetail({ organizationId, repository, onError }: { organizatio
return <section className={styles.detail} aria-label={`${repository.fullName} details`}>
<header className={styles.detailHeader}><div><span className={styles.repoOwner}>{repository.fullName.split("/")[0]}</span><h2>{repository.fullName.split("/").slice(1).join("/") || repository.fullName}</h2><div className={styles.meta}><span><DashboardIcon name={repository.private ? "lock" : "repositories"} />{repository.private ? "Private" : "Public"}</span>{p?.branch && <span>{p.branch}</span>}{p?.revision && <code title={p.revision}>{p.revision.slice(0, 7)}</code>}</div></div><a className={shared.secondaryButton} href={githubURL} target="_blank" rel="noreferrer">View on GitHub<DashboardIcon name="arrow" /></a></header>
{!repository.private && PublicRepositoryNotice && <PublicRepositoryNotice repositoryId={String(repository.id)} />}
<div className={styles.indexAction}><div><h3>Repository context</h3><p>{empty ? "There are no commits to index yet." : p?.indexed ? "Your indexed code is available to Ask AI." : "Index your code to understand this repository and ask questions about it."}</p></div><div className={styles.indexButtons}>{active && <button className={`${shared.secondaryButton} ${styles.stopButton}`} disabled={pending} => void stop()}>Stop</button>}{!active && supportRequired && supportAvailable ? <Link className={shared.primaryButton} href={supportHref}>Contact support<DashboardIcon name="arrow" /></Link> : <button className={shared.primaryButton} disabled={!loaded || active || pending || freshness?.up_to_date || !eligibility?.allowed} => void start()}><DashboardIcon name={active ? "history" : "plus"} />{pending ? "Starting…" : active ? (p?.analyze_only ? "Analyzing…" : "Indexing…") : freshness?.up_to_date ? "Index up to date" : p?.indexed ? "Reindex repository" : "Index repository"}</button>}</div></div>
{loaded && !active && eligibility && !eligibility.allowed && <p className={styles.eligibilityNotice}>{supportRequired ? `${eligibility.size_bytes != null ? `${(eligibility.size_bytes / 1024 / 1024).toLocaleString(undefined, { maximumFractionDigits: 1 })} MB reported by GitHub. ` : ""}Repositories over 500 MB require ${supportAvailable ? "support" : "administrator"} assistance. No clone will be downloaded.` : eligibility.reason || "Repository size could not be verified. Refresh to try again."}</p>}
<div className={styles.indexAction}><div><h3>Repository context</h3><p>{empty ? "There are no commits to index yet." : p?.indexed && !active && freshness?.scheduled_at && !freshness.check_failed ? `Index is stale. Automatic refresh is scheduled for ${new Date(freshness.scheduled_at).toLocaleString()}. You can reindex now.` : p?.indexed ? "Your indexed code is available to Ask AI." : "Index your code to understand this repository and ask questions about it."}</p></div><div className={styles.indexButtons}>{active && <button className={`${shared.secondaryButton} ${styles.stopButton}`} disabled={pending} => void stop()}>Stop</button>}{!active && supportRequired && supportAvailable ? <Link className={shared.primaryButton} href={supportHref}>Contact support<DashboardIcon name="arrow" /></Link> : <button className={shared.primaryButton} disabled={!loaded || active || pending || freshness?.up_to_date || !eligibility?.allowed} => void start()}><DashboardIcon name={active ? "history" : "plus"} />{pending ? "Starting…" : active ? (p?.analyze_only ? "Analyzing…" : "Indexing…") : freshness?.up_to_date ? "Index up to date" : p?.indexed ? "Reindex repository" : "Index repository"}</button>}</div></div>
{loaded && !active && eligibility && !eligibility.allowed && <p className={styles.eligibilityNotice}>{supportRequired ? `${eligibility.size_bytes != null ? `${(eligibility.size_bytes / 1024 / 1024).toLocaleString(undefined, { maximumFractionDigits: 1 })} MB reported by GitHub. ` : ""}Repositories over ${(eligibility.limit_bytes / 1024 / 1024).toLocaleString()} MB require ${supportAvailable ? "support" : "administrator"} assistance. No clone will be downloaded.` : eligibility.reason || "Repository size could not be verified. Refresh to try again."}</p>}
<Notification tone="error" message={error} notificationKey={retry} action={!loaded ? { label: "Retry loading repository", onClick: () => setRetry(value => value + 1) } : undefined} />
{!loaded && !error && <p className={styles.loading}>Loading repository details…</p>}
{index && <div className={styles.indexStatus}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/review-fix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function ReviewFix({ jobId, pullUrl, request, openFindingCount, onReviewL
const blockedMessage = !state?.latest_review ? reviewBlockerMessage(state?.review_blocker) : undefined;
const stale = !!state?.review_stale && !active && !completed;
const status = pending ? "Starting fix…" : fix?.status === "queued" ? "Fix queued" : fix?.status === "paused" ? edition.fix.pausedStatus : "Fixing findings…";
const label = checking ? "Checking PR status…" : unverified ? "PR status unavailable" : closed ? "Fix with AI" : active ? status : state?.approval ? "Review file permissions" : fix?.retryable ? "Retry fix" : fix ? "Fix stopped" : "Fix with AI";
const label = checking ? "Checking PR status…" : unverified ? "PR status unavailable" : active ? status : state?.approval ? "Review file permissions" : fix?.retryable ? "Retry Auto Fix" : fix ? "Fix stopped" : "Auto Fix";
const note = stale ? blockedMessage ? "No review is running for the new commit." : latest.ready ? "Continue on the latest PR version." : "This updates automatically." : closed ? "Auto fix is unavailable because this PR is closed." : checking ? "Checking the PR on GitHub." : unverified ? "Could not verify PR status. Retrying…" : active ? "You can leave this page." : completed ? fix.commit?.slice(0, 7) : "One commit. Same PR.";
const notification = <Notification tone={error || fixError ? "error" : "info"} message={error || fixError || state?.reason} notificationKey={errors.jobId === jobId && errors.action ? `action-${errors.revision}` : fixError ? notice?.fix?.id : undefined} />;
if (closed || (!openFindingCount && !active && !completed && !stale) || (state && !state.available && !fix && !unverified && !stale && !state.review_reason)) return error ? notification : null;
Expand Down
Loading
Loading
0