This commit is contained in:
@@ -48,8 +48,10 @@ Use `.env.local` for local secrets. Keep `.env.local` and any real token-bearing
|
||||
- Add URL is enabled only when the active tab's base URL is not already in the URLs list. The user must pick either a workspace or a Gitea repo; the app infers the linked counterpart from local context.
|
||||
- URLs can be deleted from the URLs list. User-added URLs are removed from storage; generated known URLs are hidden through the stored deleted-base list.
|
||||
- Add Issue is enabled only when the active tab's base URL is already in the URLs list and has a linked Gitea repo. The issue form must show the target repo, capture visible-tab screenshots, accept Gitea-friendly file attachments, and include `Chrome profile: Silma` in created issue bodies.
|
||||
- Newly created issues must be created with the `Change Request` label.
|
||||
- If the Ready checkbox is checked, create the issue first, upload screenshots/files as issue assets second, and apply the `ready` label last.
|
||||
- The Add Issue view also lists existing issues for the linked Gitea repo. Selecting an issue must show 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.
|
||||
- Existing issue rows must allow applying the `ready` label and deleting the issue. Deletion must require user confirmation.
|
||||
- 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.
|
||||
- The extension requests `activeTab` and `<all_urls>` host permission so screenshots can be captured from the current Chrome tab even after the side panel has stayed open across tab changes.
|
||||
|
||||
|
||||
@@ -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, 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. Add Issue is enabled when the active tab base URL is already linked to a Gitea repo; it creates an issue, uploads screenshots and files as issue assets, and can apply the `ready` label after uploads. The same view lists existing repo issues; selecting one opens a comment form with screenshots and file attachments.
|
||||
The app opens in the Chrome side panel. The top icon menu includes Add URL, URLs, Gitea repos, Workspaces, 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. Add Issue is enabled when the active tab base URL is already linked to a Gitea repo; it creates an issue with the `Change Request` label, uploads screenshots and files as issue assets, and can apply the `ready` label after uploads. The same view lists existing repo issues; selecting one opens a comment form with screenshots and file attachments, and rows can be marked Ready or 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.
|
||||
|
||||
|
||||
@@ -43,9 +43,11 @@ Required variables:
|
||||
- Screenshot capture uses Chrome's visible-tab capture API and requires the extension's `activeTab` permission plus `<all_urls>` host permission so capture still works after the side panel remains open across tab changes.
|
||||
- Captured screenshots should appear immediately in Add Issue as thumbnail rows.
|
||||
- Created issue bodies must include `Chrome profile: Silma`.
|
||||
- Newly created issues must include the `Change Request` label.
|
||||
- When Ready is checked, create the issue, upload screenshots/files as Gitea issue assets, then apply the `ready` label last.
|
||||
- The Add Issue view lists existing issues for the linked Gitea repo. Selecting an issue opens a comment form for text, additional screenshots, and file attachments.
|
||||
- Issue comments should upload screenshots/files as issue assets first, then create a comment containing links to those attachments.
|
||||
- Existing issue rows can apply the `ready` label or delete the issue. Deletion must require confirmation.
|
||||
|
||||
## URL Management
|
||||
|
||||
|
||||
@@ -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, 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. Add Issue is enabled only when the active tab base URL is known and linked to a Gitea repo. It shows the target repo, captures visible-tab screenshots with thumbnails, accepts file attachments, creates the Gitea issue, uploads assets, then applies the `ready` label if requested. Created issue bodies include `Chrome profile: Silma`. The Add Issue view also lists existing issues for the linked repo; selecting an issue opens a comment form with text, screenshots, and file attachments. 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, 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. Add Issue is enabled only when the active tab base URL is known and linked to a Gitea repo. It shows the target repo, captures visible-tab screenshots with thumbnails, accepts file attachments, creates the Gitea issue with the `Change Request` label, uploads assets, then applies the `ready` label if requested. Created issue bodies include `Chrome profile: Silma`. The Add Issue view also lists existing issues for the linked repo; selecting an issue opens a comment form with text, screenshots, and file attachments. Existing issue rows can be marked Ready or deleted after confirmation. 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`.
|
||||
|
||||
|
||||
+2
-2
@@ -50,8 +50,8 @@
|
||||
"repo_ordering": "Gitea repos are ordered by latest default-branch commit timestamp.",
|
||||
"add_url_behavior": "The user must pick either a workspace or a Gitea repo. The app infers the linked counterpart from local context and stores the URL link in chrome.storage.local.",
|
||||
"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 for the active known URL, captures visible-tab screenshots with thumbnails, accepts file attachments, creates a Gitea issue, uploads screenshots/files as issue assets, then applies the ready label after uploads when requested. Issue bodies include Chrome profile: Silma. The view intentionally omits the redundant Add Issue header copy and keeps the Ready checkbox label short.",
|
||||
"issue_comment_behavior": "The Add Issue view lists existing issues for the active URL's linked Gitea repo. Selecting an issue opens a comment form that accepts text, screenshots, and file attachments, uploads attachments as issue assets, and submits a Gitea issue comment with attachment links.",
|
||||
"add_issue_behavior": "The form shows the target repo for the active known URL, captures visible-tab screenshots with thumbnails, accepts file attachments, creates a Gitea issue with the Change Request label, uploads screenshots/files as issue assets, then applies the ready label after uploads when requested. Issue bodies include Chrome profile: Silma. The view intentionally omits the redundant Add Issue header copy and keeps the Ready checkbox label short.",
|
||||
"issue_comment_behavior": "The Add Issue view lists existing issues for the active URL's linked Gitea repo. Selecting an issue opens a comment form that accepts text, screenshots, and file attachments, uploads attachments as issue assets, and submits a Gitea issue comment with attachment links. Issue rows can apply the ready label or delete the issue after confirmation.",
|
||||
"known_urls": [
|
||||
{
|
||||
"url": "http://100.66.226.22:23030/",
|
||||
|
||||
+14
-2
@@ -133,11 +133,18 @@ export async function getCurrentGiteaUser(): Promise<GiteaUser> {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function createGiteaIssue(owner: string, repo: string, title: string, body: string): Promise<CreatedGiteaIssue> {
|
||||
export async function createGiteaIssue(
|
||||
owner: string,
|
||||
repo: string,
|
||||
title: string,
|
||||
body: string,
|
||||
labelIds: number[] = []
|
||||
): Promise<CreatedGiteaIssue> {
|
||||
const client = createGiteaClient();
|
||||
const response = await client.post<GiteaIssueResponse>(`/repos/${owner}/${repo}/issues`, {
|
||||
title,
|
||||
body
|
||||
body,
|
||||
labels: labelIds
|
||||
});
|
||||
|
||||
const number = response.data.number;
|
||||
@@ -209,6 +216,11 @@ export async function createGiteaIssueComment(
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteGiteaIssue(owner: string, repo: string, issueNumber: number): Promise<void> {
|
||||
const client = createGiteaClient();
|
||||
await client.delete(`/repos/${owner}/${repo}/issues/${issueNumber}`);
|
||||
}
|
||||
|
||||
async function getGiteaLabels(owner: string, repo: string): Promise<GiteaLabelResponse[]> {
|
||||
const client = createGiteaClient();
|
||||
const response = await client.get<GiteaLabelResponse[]>(`/repos/${owner}/${repo}/labels`, {
|
||||
|
||||
+25
-1
@@ -319,6 +319,8 @@ function renderScreenshotList(screenshots: ScreenshotAttachment[], deleteAction:
|
||||
}
|
||||
|
||||
function renderIssueRows(issues: GiteaIssueSummary[], selectedIssueNumber: number | null): string {
|
||||
const state = appStore.getState();
|
||||
|
||||
if (!issues.length) {
|
||||
return `<div class="empty-state">No issues found for this repo.</div>`;
|
||||
}
|
||||
@@ -328,12 +330,16 @@ function renderIssueRows(issues: GiteaIssueSummary[], selectedIssueNumber: numbe
|
||||
${issues
|
||||
.map(
|
||||
(issue) => `
|
||||
<button class="issue-row" type="button" data-select-issue="${issue.number}" data-selected="${issue.number === selectedIssueNumber ? "true" : "false"}">
|
||||
<div class="issue-row" data-selected="${issue.number === selectedIssueNumber ? "true" : "false"}">
|
||||
<button class="issue-select-button" type="button" data-select-issue="${issue.number}">
|
||||
<span class="issue-number">#${issue.number}</span>
|
||||
<span class="issue-title">${escapeHtml(issue.title)}</span>
|
||||
<span class="issue-state">${escapeHtml(issue.state)}</span>
|
||||
<span class="issue-meta">${formatDate(issue.updatedAt)}</span>
|
||||
</button>
|
||||
<button class="secondary-button compact-button" type="button" data-ready-issue="${issue.number}" ${state.isUpdatingIssue ? "disabled" : ""}>Ready</button>
|
||||
<button class="danger-button compact-button" type="button" data-delete-issue="${issue.number}" ${state.isUpdatingIssue ? "disabled" : ""}>Delete</button>
|
||||
</div>
|
||||
`
|
||||
)
|
||||
.join("")}
|
||||
@@ -563,6 +569,24 @@ function bindViewActions(): void {
|
||||
});
|
||||
});
|
||||
|
||||
viewContent?.querySelectorAll<HTMLButtonElement>("[data-ready-issue]").forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const issueNumber = Number(button.dataset.readyIssue);
|
||||
if (Number.isFinite(issueNumber)) {
|
||||
void appStore.getState().markIssueReady(issueNumber);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
viewContent?.querySelectorAll<HTMLButtonElement>("[data-delete-issue]").forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const issueNumber = Number(button.dataset.deleteIssue);
|
||||
if (Number.isFinite(issueNumber) && window.confirm(`Delete issue #${issueNumber}?`)) {
|
||||
void appStore.getState().deleteIssue(issueNumber);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
viewContent?.querySelector<HTMLButtonElement>("#refresh-target-issues")?.addEventListener("click", () => {
|
||||
void appStore.getState().loadTargetIssues(true);
|
||||
});
|
||||
|
||||
+70
-1
@@ -3,6 +3,7 @@ import {
|
||||
addGiteaIssueLabels,
|
||||
createGiteaIssueComment,
|
||||
createGiteaIssue,
|
||||
deleteGiteaIssue,
|
||||
ensureGiteaLabel,
|
||||
getCurrentGiteaUser,
|
||||
getGiteaIssues,
|
||||
@@ -72,6 +73,7 @@ interface AppState {
|
||||
isCapturingIssueCommentScreenshot: boolean;
|
||||
isCreatingIssue: boolean;
|
||||
isCreatingIssueComment: boolean;
|
||||
isUpdatingIssue: boolean;
|
||||
statusMessage: string;
|
||||
statusTone: StatusTone;
|
||||
clearStatus: () => void;
|
||||
@@ -85,6 +87,8 @@ interface AppState {
|
||||
deleteIssueCommentScreenshot: (id: string) => void;
|
||||
selectIssue: (issueNumber: number) => void;
|
||||
loadTargetIssues: (force?: boolean) => Promise<void>;
|
||||
markIssueReady: (issueNumber: number) => Promise<void>;
|
||||
deleteIssue: (issueNumber: number) => Promise<void>;
|
||||
captureIssueCommentScreenshot: () => Promise<void>;
|
||||
createIssueComment: () => Promise<void>;
|
||||
captureScreenshot: () => Promise<void>;
|
||||
@@ -422,6 +426,7 @@ export const appStore = createStore<AppState>()((set, get) => ({
|
||||
isCapturingIssueCommentScreenshot: false,
|
||||
isCreatingIssue: false,
|
||||
isCreatingIssueComment: false,
|
||||
isUpdatingIssue: false,
|
||||
statusMessage: "",
|
||||
statusTone: "neutral",
|
||||
clearStatus: () => {
|
||||
@@ -529,6 +534,63 @@ export const appStore = createStore<AppState>()((set, get) => ({
|
||||
set({ isLoadingTargetIssues: false });
|
||||
}
|
||||
},
|
||||
markIssueReady: async (issueNumber) => {
|
||||
const target = getTargetRepo(appStore.getState());
|
||||
|
||||
if (!target) {
|
||||
setStatus(set, "Open a known URL with a linked Gitea repo before updating an issue.", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
set({ isUpdatingIssue: true });
|
||||
setStatus(set, `Applying ready label to issue #${issueNumber}...`, "neutral", { autoClear: false });
|
||||
|
||||
try {
|
||||
const readyLabel = await ensureGiteaLabel(target.owner, target.repo, "ready");
|
||||
await addGiteaIssueLabels(target.owner, target.repo, issueNumber, [readyLabel.id]);
|
||||
await appStore.getState().loadTargetIssues(true);
|
||||
setStatus(set, `Applied ready label to issue #${issueNumber}.`, "success");
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : "Could not apply the ready label.";
|
||||
setStatus(set, message, "error");
|
||||
} finally {
|
||||
set({ isUpdatingIssue: false });
|
||||
}
|
||||
},
|
||||
deleteIssue: async (issueNumber) => {
|
||||
const target = getTargetRepo(appStore.getState());
|
||||
|
||||
if (!target) {
|
||||
setStatus(set, "Open a known URL with a linked Gitea repo before deleting an issue.", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
set({ isUpdatingIssue: true });
|
||||
setStatus(set, `Deleting issue #${issueNumber}...`, "neutral", { autoClear: false });
|
||||
|
||||
try {
|
||||
await deleteGiteaIssue(target.owner, target.repo, issueNumber);
|
||||
set((state) => ({
|
||||
targetIssues: state.targetIssues.filter((issue) => issue.number !== issueNumber),
|
||||
selectedIssueNumber: state.selectedIssueNumber === issueNumber ? null : state.selectedIssueNumber,
|
||||
issueCommentDraft:
|
||||
state.selectedIssueNumber === issueNumber
|
||||
? {
|
||||
content: "",
|
||||
screenshots: [],
|
||||
files: []
|
||||
}
|
||||
: state.issueCommentDraft
|
||||
}));
|
||||
await appStore.getState().loadTargetIssues(true);
|
||||
setStatus(set, `Deleted issue #${issueNumber}.`, "success");
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : "Could not delete the Gitea issue.";
|
||||
setStatus(set, message, "error");
|
||||
} finally {
|
||||
set({ isUpdatingIssue: false });
|
||||
}
|
||||
},
|
||||
captureScreenshot: async () => {
|
||||
set({ isCapturingScreenshot: true });
|
||||
setStatus(set, "Capturing screenshot...", "neutral", { autoClear: false });
|
||||
@@ -654,7 +716,14 @@ export const appStore = createStore<AppState>()((set, get) => ({
|
||||
setStatus(set, "Creating Gitea issue...", "neutral", { autoClear: false });
|
||||
|
||||
try {
|
||||
const issue = await createGiteaIssue(target.owner, target.repo, subject, buildIssueBody(state, target.knownUrl));
|
||||
const changeRequestLabel = await ensureGiteaLabel(target.owner, target.repo, "Change Request", "1d76db");
|
||||
const issue = await createGiteaIssue(
|
||||
target.owner,
|
||||
target.repo,
|
||||
subject,
|
||||
buildIssueBody(state, target.knownUrl),
|
||||
[changeRequestLabel.id]
|
||||
);
|
||||
const uploads = [
|
||||
...state.issueDraft.screenshots.map((screenshot) => ({
|
||||
name: screenshot.name,
|
||||
|
||||
+12
-2
@@ -481,14 +481,24 @@ input[readonly] {
|
||||
|
||||
.issue-row {
|
||||
display: grid;
|
||||
grid-template-columns: 40px minmax(0, 1fr) 48px 66px;
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #d9e2ec;
|
||||
padding: 4px 6px;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.issue-select-button {
|
||||
display: grid;
|
||||
grid-template-columns: 40px minmax(0, 1fr) 48px 66px;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: #243b53;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
|
||||
Reference in New Issue
Block a user