fix(external-plugins): prevent false fast-track approvals

Exclude manually overridden submissions from first-party fast-track until a fresh intake pass clears the override label. Disable individual approval controls while intake is pending.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 821f4796-505e-4fb8-96cf-0b5bbf80a636
This commit is contained in:
Aaron Powell
2026-10-13 14:24:47 +11:00
co-authored by Copilot App
parent c9ca91fdaa
commit 4796642f48
8 changed files with 184 additions and 1 deletions
@@ -16,6 +16,7 @@ export const COLUMNS = [
const HISTORY_LIMIT = 200;
export const FIRST_PARTY_LABEL = "first party";
const MANUAL_INTAKE_OVERRIDE_LABEL = "intake-manually-overridden";
const PENDING_INTAKE_LABELS = ["awaiting-review", "requires-submitter-fixes"];
export function isReadyForApproval(labels) {
@@ -30,6 +31,7 @@ function applyFirstPartyFastTrack(item) {
!item.labels?.includes(FIRST_PARTY_LABEL) ||
!item.labels?.includes("ready-for-review") ||
item.labels?.some((label) => PENDING_INTAKE_LABELS.includes(label)) ||
item.labels?.includes(MANUAL_INTAKE_OVERRIDE_LABEL) ||
item.fastTrackDismissed ||
item.decision ||
item.review ||
@@ -54,6 +56,7 @@ function clearFirstPartyFastTrack(item) {
if (
(item.labels?.includes(FIRST_PARTY_LABEL) &&
item.labels?.includes("ready-for-review") &&
!item.labels?.includes(MANUAL_INTAKE_OVERRIDE_LABEL) &&
!item.labels?.some((label) => PENDING_INTAKE_LABELS.includes(label))) ||
!item.review?.fastTracked ||
item.reviewStatus === "queued"
@@ -412,7 +412,7 @@ function renderDrawer() {
ui.drawerFooter.hidden = Boolean(item.decision);
updatePreview();
ui.approve.disabled = bulkBusy || Boolean(item.pendingDecision);
ui.approve.disabled = bulkBusy || !item.reviewEligible || Boolean(item.pendingDecision);
ui.reject.disabled ||= bulkBusy || Boolean(item.pendingDecision);
renderTab(item);
}
@@ -584,6 +584,7 @@ function resetConfirm() {
ui.approve.disabled = true;
ui.reject.disabled = true;
}
if (!item?.reviewEligible) ui.approve.disabled = true;
}
async function decide(kind) {