Skip to content

Commit 19f5c11

Browse files
Fix issue-write repo owner mapping and clear stale UI state on reset
- issue-write: derive owner/name from full_name since search_repositories minimal output omits the owner object (mirrors pr-write) - pr-write/issue-write: clear available branch/label/assignee/milestone/type lists and filters in the toolInput reset effect so prefill effects can't match against the previous repo's stale data Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6f6e826 commit 19f5c11

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

ui/src/apps/issue-write/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,15 @@ function CreateIssueApp() {
432432
setSelectedIssueType(null);
433433
setSuccessIssue(null);
434434
setError(null);
435+
// Clear available metadata (and filters) so prefill effects, which are gated
436+
// on these lists being non-empty, can't match against the previous repo's data
437+
// before the new repo's ui_get calls resolve.
438+
setAvailableLabels([]);
439+
setAvailableAssignees([]);
440+
setAvailableMilestones([]);
441+
setAvailableIssueTypes([]);
442+
setLabelsFilter("");
443+
setAssigneesFilter("");
435444
if (toolInput?.owner && toolInput?.repo) {
436445
setSelectedRepo({
437446
id: `${toolInput.owner}/${toolInput.repo}`,

ui/src/apps/pr-write/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ function CreatePRApp() {
181181
setSuccessPR(null);
182182
setError(null);
183183
setSubmittedTitle("");
184+
// Clear branch list and filters so a new invocation doesn't briefly show stale
185+
// branches from the previous repo (or allow selecting invalid options) before the
186+
// new repo's ui_get branches call resolves.
187+
setAvailableBranches([]);
188+
setBaseFilter("");
189+
setHeadFilter("");
184190
if (toolInput?.owner && toolInput?.repo) {
185191
setSelectedRepo({
186192
id: `${toolInput.owner}/${toolInput.repo}`,

0 commit comments

Comments
 (0)