Fix selected issue update flow
Build / build (push) Successful in 11s

This commit is contained in:
2026-07-18 12:57:11 -05:00
parent c9c2a71dcd
commit cb33bc0aa1
7 changed files with 57 additions and 9 deletions
+1
View File
@@ -56,6 +56,7 @@ Use `.env.local` for local secrets. Keep `.env.local` and any real token-bearing
- If the Ready checkbox is checked, create the issue first, upload the rendered agent file plus screenshots/files as issue assets second, and apply the `ready` label last.
- Open Issues owns issue browsing and follow-up. It must list recent issues ordered by creation time, default to open issues for the active URL's linked repo, provide a checkbox to show issues across all loaded repos, and provide a status dropdown for Open, Closed, or Open + Closed.
- Selecting an Open Issues row must show a direct Open in Gitea link, editable issue subject/content fields, issue attachments, and comment chain, followed by a comment form that can add text, take additional screenshots, attach files, upload those files as issue assets, and submit a Gitea comment with attachment links.
- Saving selected issue edits must use the selected issue's repo identity from Open Issues and must never fall back to the active tab's repo.
- Existing issue rows must allow applying the `ready` label and deleting the issue. Existing issue attachments must be removable. Deletion must require user confirmation.
- Text-entry updates in Add Issue, selected issue edits, Open Issues comments, and Agents must not re-render the focused form control or blur the user while they type.
- Keep the Add Issue view dense; do not show the redundant view header title/description inside this view, and keep the Ready checkbox label short.
+1 -1
View File
@@ -26,7 +26,7 @@ The deployable extension output is `dist/`. Load `dist/` in Chrome as an unpacke
Static assets, including the extension icon assets, live in `public/` and are copied into `dist/` during the build.
The app opens in the Chrome side panel. The top icon menu includes Add URL, URLs, Gitea repos, Workspaces, Agents, Open Issues, and Add Issue. Add URL is enabled only for an active tab base URL that is not already in the URLs list. URLs can be deleted from the list. The Agents view manages persisted agent files, starting with `GLOBAL AGENT` from `AGENTS.md`; agents can use variables such as `{{git}}`, `{{workspace}}`, and `{{url}}` in their markdown content. Add Issue is enabled when the active tab base URL is already linked to a Gitea repo; it shows the active URL being attached, creates an issue with the selected agent and `Change Request` label, uploads the rendered agent file plus accumulated screenshots and files as issue assets, and can apply the `ready` label after uploads. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll crop panel. Open Issues lists recent issues by creation time, defaults to open issues for the current repo, can expand to all loaded repos, can filter Open/Closed/Open + Closed, and lets a selected issue open directly in Gitea, edit subject/content, view attachments and comments, and add a comment with screenshots and file attachments. Rows can be marked Ready or deleted, and existing issue attachments can be deleted.
The app opens in the Chrome side panel. The top icon menu includes Add URL, URLs, Gitea repos, Workspaces, Agents, Open Issues, and Add Issue. Add URL is enabled only for an active tab base URL that is not already in the URLs list. URLs can be deleted from the list. The Agents view manages persisted agent files, starting with `GLOBAL AGENT` from `AGENTS.md`; agents can use variables such as `{{git}}`, `{{workspace}}`, and `{{url}}` in their markdown content. Add Issue is enabled when the active tab base URL is already linked to a Gitea repo; it shows the active URL being attached, creates an issue with the selected agent and `Change Request` label, uploads the rendered agent file plus accumulated screenshots and files as issue assets, and can apply the `ready` label after uploads. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll crop panel. Open Issues lists recent issues by creation time, defaults to open issues for the current repo, can expand to all loaded repos, can filter Open/Closed/Open + Closed, and lets a selected issue open directly in Gitea, edit subject/content against that issue's repo, view attachments and comments, and add a comment with screenshots and file attachments. Rows can be marked Ready or deleted, and existing issue attachments can be deleted.
Builds generate `public/local-context.json` from `/Users/Tabitha/.openclaw/workspace_Father`. That snapshot links known workspaces to local Gitea repos and is copied into `dist/` so the built extension is self-contained.
+1
View File
@@ -58,6 +58,7 @@ Required variables:
- Turning off `Only current repo` loads recent issues from all repos already loaded in the extension.
- The status dropdown defaults to `Open` and supports `Open`, `Closed`, and `Open + Closed`.
- Selecting an issue shows a direct Open in Gitea link, editable issue subject/content fields, issue attachments, comment chain, and a comment form for text, additional screenshots, and file attachments.
- Saving selected issue edits must use the repo identity from the selected Open Issues row and must not fall back to the active tab's repo.
- Issue comments should upload screenshots/files as issue assets first, then create a comment containing links to those attachments.
- Existing issue attachments can be deleted from the selected issue.
- Existing issue rows can apply the `ready` label or delete the issue. Deletion must require confirmation.
+1 -1
View File
@@ -19,7 +19,7 @@ Important files:
Build with `npm run build`. The deployable output directory is `dist/`; load that folder in Chrome as an unpacked extension or point deployment tooling at it. Do not edit `dist/` directly.
UI behavior: the app renders as a Chrome side panel, not a draggable window. The menu items are Add URL, URLs, Gitea Repos, Workspaces, Agents, Open Issues, and Add Issue. Add URL is enabled only when the active tab base URL is not already known; the user must choose either a workspace or a Gitea repo, and the app infers the linked counterpart. URLs can be deleted from the list; user-added URLs are removed from storage, while generated known URLs are hidden through stored deleted bases. The Agents view manages persisted agent files and starts with `GLOBAL AGENT` backed by `AGENTS.md`; agent markdown can use `{{git}}`, `{{repo}}`, `{{workspace}}`, `{{url}}`, `{{baseUrl}}`, `{{profile}}`, and `{{issue}}` template variables. Add Issue is enabled only when the active tab base URL is known and linked to a Gitea repo. It shows the target repo and active URL, captures visible-tab screenshots with thumbnails, accepts accumulated file attachments, lets the user select an agent file, creates the Gitea issue with the `Change Request` label, uploads the rendered agent file plus all screenshots/files, then applies the `ready` label if requested. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll draggable/resizable crop panel. Created issue bodies include `Chrome profile: Silma` and the selected agent. Open Issues lists recent issues by creation time, defaults to open issues for the active URL's linked repo through an `Only current repo` checkbox, can load recent issues across all loaded repos, supports Open/Closed/Open + Closed status filtering, and shows selected issue subject/content edit fields, a direct Open in Gitea link, attachments, comment chains, and a comment form with text, screenshots, and file attachments. Existing issue rows can be marked Ready or deleted after confirmation, and existing issue attachments can be deleted. Text-entry state updates must not blur focused Add Issue, selected issue edit, Open Issues comment, or Agents editor controls. Gitea repos are ordered by latest default-branch commit. Workspace and URL views show established links between local workspaces, known URLs, and Gitea repos.
UI behavior: the app renders as a Chrome side panel, not a draggable window. The menu items are Add URL, URLs, Gitea Repos, Workspaces, Agents, Open Issues, and Add Issue. Add URL is enabled only when the active tab base URL is not already known; the user must choose either a workspace or a Gitea repo, and the app infers the linked counterpart. URLs can be deleted from the list; user-added URLs are removed from storage, while generated known URLs are hidden through stored deleted bases. The Agents view manages persisted agent files and starts with `GLOBAL AGENT` backed by `AGENTS.md`; agent markdown can use `{{git}}`, `{{repo}}`, `{{workspace}}`, `{{url}}`, `{{baseUrl}}`, `{{profile}}`, and `{{issue}}` template variables. Add Issue is enabled only when the active tab base URL is known and linked to a Gitea repo. It shows the target repo and active URL, captures visible-tab screenshots with thumbnails, accepts accumulated file attachments, lets the user select an agent file, creates the Gitea issue with the `Change Request` label, uploads the rendered agent file plus all screenshots/files, then applies the `ready` label if requested. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll draggable/resizable crop panel. Created issue bodies include `Chrome profile: Silma` and the selected agent. Open Issues lists recent issues by creation time, defaults to open issues for the active URL's linked repo through an `Only current repo` checkbox, can load recent issues across all loaded repos, supports Open/Closed/Open + Closed status filtering, and shows selected issue subject/content edit fields that save against the selected issue repo, a direct Open in Gitea link, attachments, comment chains, and a comment form with text, screenshots, and file attachments. Existing issue rows can be marked Ready or deleted after confirmation, and existing issue attachments can be deleted. Text-entry state updates must not blur focused Add Issue, selected issue edit, Open Issues comment, or Agents editor controls. Gitea repos are ordered by latest default-branch commit. Workspace and URL views show established links between local workspaces, known URLs, and Gitea repos.
Extension management rule: use the Codex Chrome extension with the Chrome profile named `Silma`. Do not use `Profile 1`.
+1 -1
View File
@@ -61,7 +61,7 @@
"delete_url_behavior": "URLs can be deleted from the list. User-added URLs are removed from chrome.storage.local; generated known URLs are hidden by storing their base URL in silmaAide.deletedUrlBases.",
"add_issue_behavior": "The form shows the target repo and active URL for the active known URL, lets the user select an agent file, captures visible-tab screenshots with thumbnails, accepts accumulated file attachments, creates a Gitea issue with the Change Request label, uploads the rendered agent file plus all screenshots/files as issue assets, then applies the ready label after uploads when requested. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll draggable/resizable crop panel. Issue bodies include Chrome profile: Silma and the selected agent. The view intentionally omits the redundant Add Issue header copy and keeps the Ready checkbox label short.",
"open_issues_behavior": "Open Issues lists recent issues ordered by creation time. The Only current repo checkbox defaults to true and limits rows to the active URL's linked Gitea repo; disabling it loads recent issues from all repos already loaded by the extension. The status dropdown defaults to Open and supports Open, Closed, and Open + Closed.",
"issue_comment_behavior": "Open Issues owns existing issue follow-up. Selecting an issue shows a direct Open in Gitea link, editable issue subject/content fields, issue attachments, comment chain, and a comment form that accepts text, screenshots, and file attachments, uploads attachments as issue assets, and submits a Gitea issue comment with attachment links. Existing issue attachments can be deleted. Issue rows can apply the ready label or delete the issue after confirmation. Draft text-entry updates must not blur focused Add Issue, selected issue edit, Open Issues comment, or Agents editor controls.",
"issue_comment_behavior": "Open Issues owns existing issue follow-up. Selecting an issue shows a direct Open in Gitea link, editable issue subject/content fields that save against the selected issue repo, issue attachments, comment chain, and a comment form that accepts text, screenshots, and file attachments, uploads attachments as issue assets, and submits a Gitea issue comment with attachment links. Existing issue attachments can be deleted. Issue rows can apply the ready label or delete the issue after confirmation. Draft text-entry updates must not blur focused Add Issue, selected issue edit, Open Issues comment, or Agents editor controls.",
"known_urls": [
{
"url": "http://100.66.226.22:23030/",
+25 -2
View File
@@ -180,6 +180,25 @@ function createGiteaClient() {
});
}
function getGiteaErrorMessage(error: unknown, fallback: string): string {
if (!axios.isAxiosError(error)) {
return error instanceof Error ? error.message : fallback;
}
const status = error.response?.status;
const data = error.response?.data;
const detail =
typeof data === "string"
? data
: typeof data?.message === "string"
? data.message
: typeof data?.error === "string"
? data.error
: error.message;
return status ? `${fallback} Gitea returned ${status}: ${detail}` : `${fallback} ${detail}`;
}
export async function getCurrentGiteaUser(): Promise<GiteaUser> {
const client = createGiteaClient();
const response = await client.get<GiteaUser>("/user");
@@ -218,8 +237,12 @@ export async function updateGiteaIssue(
updates: { title: string; body: string }
): Promise<GiteaIssueSummary> {
const client = createGiteaClient();
const response = await client.patch<GiteaIssueResponse>(`/repos/${owner}/${repo}/issues/${issueNumber}`, updates);
return toIssueSummary(response.data, owner, repo, issueNumber);
try {
const response = await client.patch<GiteaIssueResponse>(`/repos/${owner}/${repo}/issues/${issueNumber}`, updates);
return toIssueSummary(response.data, owner, repo, issueNumber);
} catch (error) {
throw new Error(getGiteaErrorMessage(error, "Could not update the Gitea issue."));
}
}
export async function getGiteaIssues(
+27 -4
View File
@@ -1255,12 +1255,13 @@ export const appStore = createStore<AppState>()((set, get) => ({
})),
saveSelectedIssueEdits: async () => {
const state = appStore.getState();
const target = getIssueTarget(state);
const issueNumber = state.selectedIssueNumber;
const repoFullName = state.selectedIssueRepoFullName;
const target = repoFullName ? getRepoTargetByFullName(state, repoFullName) : null;
const subject = state.selectedIssueEditDraft.subject.trim();
if (!target || !issueNumber) {
setStatus(set, "Select an issue before editing it.", "error");
setStatus(set, "Select an issue from Open Issues before editing it.", "error");
return;
}
@@ -1273,11 +1274,33 @@ export const appStore = createStore<AppState>()((set, get) => ({
setStatus(set, `Saving issue #${issueNumber}...`, "neutral", { autoClear: false });
try {
await updateGiteaIssue(target.owner, target.repo, issueNumber, {
const updatedIssue = await updateGiteaIssue(target.owner, target.repo, issueNumber, {
title: subject,
body: state.selectedIssueEditDraft.content
});
await appStore.getState().loadOpenIssues(true);
const updatedOpenIssue = toOpenIssue(updatedIssue, target);
set((current) => ({
openIssues: current.openIssues.map((issue) =>
issue.number === issueNumber && issue.repoFullName === target.fullName ? updatedOpenIssue : issue
),
selectedIssueRepoFullName: target.fullName,
selectedIssueDetail:
current.selectedIssueDetail && current.selectedIssueNumber === issueNumber
? {
...current.selectedIssueDetail,
issue: {
...current.selectedIssueDetail.issue,
...updatedIssue
}
}
: current.selectedIssueDetail,
selectedIssueEditDraft: {
subject: updatedIssue.title,
content: updatedIssue.body
}
}));
await appStore.getState().loadSelectedIssueDetail(true);
setStatus(set, `Saved issue #${issueNumber}.`, "success");
} catch (error) {