diff --git a/README.md b/README.md index 9bc50f9..6caa370 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,7 @@ state/data-flow, API client and account-registry design. See [`ROADMAP.md`](ROADMAP.md). Phases 0–5 are implemented. The only explicit gaps are OAuth sign-in (PAT is the supported path), content code search (no REST -endpoint), in-editor search/replace, and a handful of rare Actions/package -operations. +endpoint), and a line-level diff preview before committing. ## Known limitations @@ -202,13 +201,12 @@ operations. access tokens remain the supported mobile sign-in. - **Content code search** has no Gitea REST endpoint; the app offers "Find file" (path search over the git tree) instead. -- The in-app editor uses a self-contained WebView editor with line numbers and - syntax highlighting; in-editor search/replace and CodeMirror 6 specifically - are not built. +- The in-app editor is **CodeMirror 6** (bundled at build time) with line + numbers, syntax highlighting and a search/replace panel. - Inline review comments can be composed at a line position (best-effort diff position mapping) — verify placement against your Gitea version. -- Release assets can be uploaded/downloaded; package version-level deletion is - supported, but workflow enable/disable and package link/unlink are not. +- Gitea's issues API exposes no sort parameter, so issue sorting is client-side + (labels/milestone filtering is server-side). - Gitea's REST API exposes no total count for some endpoints, so infinite scroll falls back to a page-length heuristic. - Features that are unavailable or disabled on a given instance degrade to a diff --git a/ROADMAP.md b/ROADMAP.md index 222cf98..edf9c74 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -99,8 +99,8 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`. - [x] Notifications inbox: read/unread, mark read, mark-all-read, unread badge - [x] Lifecycle-aware notification polling tied to the refresh-interval setting - [x] Notification subject-URL parsing → issue/PR/commit/repo navigation -- [ ] Inline (line-level) review comments -- [ ] Server-side filter UI (label, milestone, assignee) and sorting +- [x] Inline (line-level) review comments (display, reply + positioned composer) +- [x] Filters (label, milestone) + sorting on the repository issue list - [x] Reactions/subscriptions (issue reactions toggle + subscribe/unsubscribe) ## Phase 4 — Code editing @@ -113,9 +113,9 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`. - [x] Stale-SHA (409) conflict handling with a clear message - [x] Unsaved-changes detection + discard - [x] Per-instance editor/IDE URL template ("Open in editor"), system-browser/app fallback -- [x] In-app code editor in a WebView (line numbers + syntax highlighting) +- [x] In-app code editor in a WebView (CodeMirror 6, line numbers, highlighting) +- [x] In-editor search/replace (CodeMirror search panel) - [x] IDE auth stays separate from Gitea API auth (no token in the URL) -- [ ] In-editor search/replace (CodeMirror 6) - [ ] Line-level diff preview before committing ## Phase 5 — Advanced features @@ -141,9 +141,9 @@ Architectural decisions are recorded in `docs/ARCHITECTURE.md`. - [x] Administration screens (users/orgs/repos, admin-gated) - [x] Find file (recursive git-tree path search) - [x] Issue reactions and subscriptions; issue attachments -- [x] Package version-level delete +- [x] Package version-level delete; link/unlink a package to a repository +- [x] Workflow enable/disable - [ ] Content code search (no Gitea REST endpoint) -- [ ] In-editor search/replace (CodeMirror 6) --- diff --git a/docs/FEATURE_PARITY.md b/docs/FEATURE_PARITY.md index 8605fd9..460551f 100644 --- a/docs/FEATURE_PARITY.md +++ b/docs/FEATURE_PARITY.md @@ -59,8 +59,8 @@ available and the version-based capability probe for the rest. | Reactions | ✅ | `GET/POST/DELETE …/issues/{n}/reactions` | toggle on issue detail | | Subscriptions | ✅ | `…/issues/{n}/subscriptions` | subscribe/unsubscribe | | Attachments | ✅ | `GET …/issues/{n}/assets` | list + download | -| Labels/milestones management | 🟡 | `GET …/labels`, `…/milestones` | read + assign; CRUD not yet | -| Server-side filters/sorting UI | 🟡 | `labels`, `milestones` params | API supports them; UI not wired | +| Labels/milestones management | ✅ | `GET/POST/PATCH/DELETE …/labels`, `…/milestones` | full CRUD (create/edit/delete) | +| Server-side filters/sorting UI | ✅ | `labels`, `milestones` params | server-side label/milestone filters; sorting is client-side (Gitea exposes no issues sort param) | | Create/edit comments on PRs | ✅ | shared issue endpoint | | ## Pull requests @@ -110,8 +110,8 @@ available and the version-based capability probe for the rest. | Stale-SHA (409) handling | ✅ | clear conflict message | | Create PR after commit | ✅ | | | Editor / IDE workspace | ✅ | configurable URL template, no token passthrough | -| In-editor search/replace | ⬜ | planned | -| CodeMirror 6 specifically | ⬜ | a self-contained WebView editor is used instead (no bundled editor assets) | +| In-editor search/replace | ✅ | CodeMirror search panel (toolbar button) | +| CodeMirror 6 | ✅ | bundled at build time into a generated TS module | ## Advanced @@ -133,5 +133,5 @@ available and the version-based capability probe for the rest. | User profile edit, SSH/GPG keys, tokens | ✅ | | Instance capability probe (version-gated) | ✅ | | Administration (users/orgs/repos, read-only, admin-gated) | ✅ | -| Workflow enable/disable | ⬜ | -| Package helpers (link/unlink to repo) | ⬜ | +| Workflow enable/disable | ✅ | +| Package helpers (link/unlink to repo) | ✅ | diff --git a/src/core/api/endpoints.test.ts b/src/core/api/endpoints.test.ts index 4d09081..65ebf84 100644 --- a/src/core/api/endpoints.test.ts +++ b/src/core/api/endpoints.test.ts @@ -9,6 +9,8 @@ import { GiteaClient } from './client'; import { addRepoKey, addIssueReaction, + createLabel, + createMilestone, createOrg, createRelease, createRepoVariable, @@ -16,11 +18,14 @@ import { deletePackageVersion, fetchRepoTree, listActionRuns, + linkPackageToRepo, listReviewComments, mergePull, putRepoSecret, replyToReviewComment, + setWorkflowEnabled, transferRepo, + unlinkPackageFromRepo, updateRepo, updateUserSettings, } from './endpoints'; @@ -177,4 +182,39 @@ describe('endpoint request bodies', () => { expect(url).toContain('/repos/octo/repo/git/trees/main'); expect(url).toContain('recursive=true'); }); + + it('creates a label and a milestone', async () => { + const { fetchImpl, client } = capture(); + await createLabel(client, 'octo', 'repo', { name: 'bug', color: 'd73a4a' }); + expect(fetchImpl.mock.calls[0][0]).toBe('https://codeberg.org/api/v1/repos/octo/repo/labels'); + expect(postedBody(fetchImpl)).toMatchObject({ name: 'bug', color: 'd73a4a' }); + + fetchImpl.mockClear(); + await createMilestone(client, 'octo', 'repo', { title: 'v1' }); + expect(fetchImpl.mock.calls[0][0]).toBe('https://codeberg.org/api/v1/repos/octo/repo/milestones'); + expect(postedBody(fetchImpl)).toMatchObject({ title: 'v1' }); + }); + + it('enables and disables a workflow', async () => { + const { fetchImpl, client } = capture(); + await setWorkflowEnabled(client, 'octo', 'repo', 'ci.yml', false); + expect(fetchImpl.mock.calls[0][0]).toBe( + 'https://codeberg.org/api/v1/repos/octo/repo/actions/workflows/ci.yml/disable', + ); + expect(fetchImpl.mock.calls[0][1].method).toBe('PUT'); + }); + + it('links and unlinks a package to a repository', async () => { + const { fetchImpl, client } = capture(); + await linkPackageToRepo(client, 'octo', 'npm', 'pkg', 'my-repo'); + expect(fetchImpl.mock.calls[0][0]).toBe( + 'https://codeberg.org/api/v1/packages/octo/npm/pkg/-/link/my-repo', + ); + + fetchImpl.mockClear(); + await unlinkPackageFromRepo(client, 'octo', 'npm', 'pkg'); + expect(fetchImpl.mock.calls[0][0]).toBe( + 'https://codeberg.org/api/v1/packages/octo/npm/pkg/-/unlink', + ); + }); });