Commit Graph

125 Commits

Author SHA1 Message Date
刘焱 2aa1b2ffe4 docs(snippet): 子命令描述和注释中文化 2026-06-08 19:56:17 +08:00
刘焱 bc12b43fc0 docs(webhook): 子命令描述和注释中文化 2026-06-08 19:56:15 +08:00
刘焱 30f16b9613 feat(interactive): 默认使用 table 格式输出,提升可读性 2026-06-08 19:53:20 +08:00
刘焱 461b28e6c8 test(interactive): smoke-test all registered commands execute without panic 2026-06-08 19:50:50 +08:00
刘焱 d66c88ecca feat(interactive): add scrollable viewport for long command output 2026-06-08 19:48:17 +08:00
刘焱 295eda5a4e feat(output): improve table readability — truncate values, limit columns, summarize nested maps 2026-06-08 19:44:22 +08:00
刘焱 25ee6cc5fb feat(output): render nested list data as table instead of falling back to JSON
When envelope.Data is a map containing a list of objects (e.g. tag +list
returns {tags: [...], total_count}), printTable previously fell back to
JSON because the map had complex values. Now it scans the map for the
largest []interface{} of map[string]interface{} and renders that list
via printSliceTable, so users see a table again.

- Add findLargestSlice helper to pick the largest table-renderable slice
- Add hasOnlyNestedMaps to distinguish scalar-only maps from nested-map maps
- Keep JSON fallback for genuinely nested (non-list) structures
- Add formatter_test.go covering all 5 branches of printTable
2026-06-08 19:32:06 +08:00
刘焱 f1dc2f8bc9 docs(shortcuts): 给每个命令组添加中文注释和中文描述
GetAllShortcuts 每个命令组加中文行内注释,说明该组用途;
GetDescriptions 描述改为中文,使交互式命令面板直接显示中文。
2026-06-08 19:18:46 +08:00
刘焱 b2136559bf fix(interactive): initialize RuntimeContext via NewRuntimeContext to prevent nil-Client panic
Selecting a command showed no output because Execute built the
RuntimeContext as a bare struct literal (&RuntimeContext{Args: args}),
leaving Client == nil. Any command calling ctx.CallAPI then panicked with
a nil pointer dereference inside the executor goroutine; the panic aborted
the goroutine before w.Close()/stdout restore, so the execResultMsg never
fired and the REPL hung silently.

Fix: use common.NewRuntimeContext(args) (initializes Client/Format/Owner/Repo,
matching runner.go), and wrap s.Run in safeRun() so a panic converts to an
error and stdout is always restored.

Adds regression tests: nil-Client assertion, panic-safe stdout restore, and
an end-to-end test that runs the real repo +list shortcut and asserts
Execute never returns (empty output, nil error).
2026-06-08 19:16:40 +08:00
刘焱 16787b8f8c fix(interactive): trigger command palette immediately on '/' keypress
Previously the palette only opened after pressing Enter because the trigger
logic lived in the KeyEnter branch. The spec requires '/' to open the palette
immediately. Now KeyRunes with '/' as the first character of an empty input
switches to statePalette right away, carrying any trailing characters (e.g.
'/iss') as the initial search query.

Adds regression tests covering: immediate '/', '/' with query, and ordinary
text staying in input state.
2026-06-08 19:09:02 +08:00
刘焱 2596d1dc70 fix(interactive): correct Esc behavior and direct-exec for optional flags 2026-06-08 18:59:00 +08:00
刘焱 65a4e60d6d feat(interactive): add REPL with command palette, form, and cobra entry 2026-06-08 18:52:23 +08:00
刘焱 db8f3c7cae feat(interactive): add command executor with stdout capture and flag parsing 2026-06-08 15:55:33 +08:00
刘焱 76cb5be259 chore: add bubbletea, bubbles, huh dependencies 2026-06-08 15:53:30 +08:00
刘焱 cbbec86b49 feat(shortcuts): export GetAllShortcuts and GetDescriptions for interactive mode 2026-06-08 15:51:21 +08:00
刘焱 503a5aeead docs: add interactive REPL implementation plan 2026-06-08 15:49:05 +08:00
刘焱 1d4e177152 docs: add interactive REPL command palette design spec 2026-06-08 14:50:21 +08:00
赵昌 d1cc68b6d9 docs: add workflow examples for issue-triage, project-health, newcomer-guide
CI / test (push) Failing after 2m9s Details
2026-06-08 11:44:09 +08:00
赵昌 6c0ad3b7ae feat: add three new skills - issue triage, project health, newcomer guide
CI / test (push) Has been cancelled Details
2026-06-08 11:39:29 +08:00
赵昌 9a51db0989 feat: add wiki and snippet skills, update webhook skill with new commands
CI / test (push) Waiting to run Details
2026-06-08 11:35:45 +08:00
wqer a4587f95c4 添加Python示例
CI / test (push) Failing after 2m5s Details
2026-06-08 11:07:01 +08:00
赵昌 38658fb7b1 feat: task-view supports both numeric ID and UUID lookup
CI / test (push) Failing after 2m8s Details
2026-06-08 10:01:56 +08:00
赵昌 5eb67055fd feat: add webhook +failed and +task-view commands
CI / test (push) Failing after 2m4s Details
- webhook +failed: list failed deliveries with --limit support
- webhook +task-view: view detailed delivery content
- Original webhook +tasks unchanged
2026-06-08 09:57:13 +08:00
赵昌 dd905fb045 docs: update report - remove hook-runner, update webhook section
CI / test (push) Failing after 2m3s Details
2026-06-04 17:39:03 +08:00
赵昌 e60e876fad merge: integrate hook-runner into webhook commands
CI / test (push) Failing after 2m6s Details
- Add webhook +failed: list failed deliveries
- Add webhook +task-view: view task details
- Enhance webhook +tasks: add --limit, show UUID
- Remove standalone hook-runner package
- Update register.go
2026-06-04 17:33:26 +08:00
赵昌 a115c97dde fix: show uuid instead of numeric id in hook-runner list output
CI / test (push) Failing after 2m6s Details
2026-06-04 17:23:06 +08:00
赵昌 66ec432036 fix: simplify hook-runner list output to essential fields only
CI / test (push) Failing after 2m7s Details
2026-06-04 17:09:59 +08:00
赵昌 cb238f132c feat: add --limit flag to hook-runner list/failed commands
CI / test (push) Failing after 1m3s Details
2026-06-04 16:23:17 +08:00
赵昌 240a4ff6b7 test: add hook-runner unit tests (list/view/failed)
CI / test (push) Failing after 2m3s Details
2026-06-04 16:21:12 +08:00
赵昌 d46a0cc48b feat: add hook-runner shortcut for webhook delivery monitoring
CI / test (push) Failing after 2m7s Details
hook-runner +list   - List webhook delivery tasks
hook-runner +view   - View specific delivery task details
hook-runner +failed - List only failed deliveries

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 16:15:30 +08:00
赵昌 59552d9286 remove: project board shortcut (duplicated with issue commands)
CI / test (push) Failing after 2m7s Details
2026-06-04 16:04:00 +08:00
s2_cc 811bae1cd5 触发流水线
CI / test (push) Failing after 1m2s Details
2026-06-04 14:33:58 +08:00
赵昌 015a30caa5 chore: remove unused testdata file
CI / test (push) Failing after 2m6s Details
2026-06-04 11:42:23 +08:00
赵昌 e3470ba592 fix: delete _Sidebar.md on wiki +delete to prevent orphaned references
CI / test (push) Failing after 2m6s Details
When a wiki page is deleted, also remove _Sidebar.md so that GitLink
regenerates it from the current file list on next web visit. This
prevents orphaned page references from accumulating in the sidebar.

Use git add -A to safely stage all changes (deleted page + sidebar)
without failing when _Sidebar.md doesn't exist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:01:10 +08:00
s2_cc 167a2ff12c fix: set GOPROXY to goproxy.cn for China network
CI / test (push) Failing after 1m2s Details
2026-06-04 10:52:46 +08:00
s2_cc 63cbb2cef8 feat: add DevOps CI pipeline for build and verification
CI / test (push) Failing after 2m6s Details
2026-06-04 10:45:32 +08:00
s2_cc 9f479a27db feat: optimize existing commands (P1-P4)
P1 Bug fixes:
- Fix issue +create --label not being sent to API
- Replace hardcoded "master" default branch with dynamic API query
- Add GetDefaultBranch() helper (common/types.go)

P2 Complete missing command parameters (10 items, 39 new flags):
- issue +list: --milestone, --assignee, --label, --keyword, --sort, --sort-direction
- issue +update: --milestone, --assignee, --label, --priority (expanded validation)
- issue +close: --comment (post journal on close)
- pr +list: --keyword, --milestone, --tag, --reviewer, --assignee, --sort, --sort-direction
- pr +create: --priority, --assignee, --milestone, --label (multi-label support)
- pr +merge: validate --method values, add --title, --body
- ci +builds: --status, --branch, --event, --since, --until
- search +repos: --language, --sort, --order
- search +users: --sort, --order
- release +list: --prerelease-only, --latest (client-side filtering)

P3 Batch operations (9 new commands with generic batch framework):
- Add common/batch.go: BatchSummary, CollectNumbers, ProcessBatch, CSV parsing
- Add common/confirm.go: ConfirmAction with --yes skip
- issue +batch-update: native batch_update API with ID mapping
- issue +batch-destroy: native batch_destroy API
- Refactor issue +batch-close to use common batch utilities
- pr +batch-close, pr +batch-merge
- collaborator +batch-add, +batch-remove, +batch-role
- branch +batch-delete, +batch-protect

P4 Help docs, confirm prompts, and error messages:
- Add Long description and Example to all 18 command groups
- Add confirmation prompt to destructive operations (repo/branch/release delete, ci stop)
- Improve HTTP error messages with contextual hints (401/403/404/422/500)
- Replace hardcoded Chinese strings with English in release +delete
2026-06-04 10:45:32 +08:00
赵昌 f18eea273f revert: remove sidebar cleanup from wiki +delete
CI / test (push) Failing after 2m3s Details
Modifying _Sidebar.md causes wiki page rendering to break on the
web UI. Delete now only removes the .md file and leaves sidebar
management to GitLink's web interface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:38:29 +08:00
赵昌 6fda83bf38 fix: clean _Sidebar.md reference on wiki +delete
CI / test (push) Failing after 1m2s Details
Add safe sidebar cleanup using a separate helper file (sidebar.go)
to avoid encoding issues. Only removes the page reference, never
adds or modifies other content.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:24:20 +08:00
赵昌 92a953ba56 test: update snippet tests for Git-based operations
CI / test (push) Failing after 2m7s Details
Rewrite tests to use local Git repositories for list/view (Git-based)
and HTTP test servers for create/delete (API-based). Add
repoGitURLOverride variable for test isolation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 09:13:57 +08:00
wqer 9a2e6a3280 Delete snippet "hello.py"
CI / test (push) Failing after 1m2s Details
2026-06-04 08:54:21 +08:00
wqer 3a47936f9f 创建测试
CI / test (push) Has been cancelled Details
2026-06-04 08:53:36 +08:00
赵昌 15110df6f1 fix: use Git operations for snippet list/view/delete
CI / test (push) Failing after 2m5s Details
Snippet list and view now clone the repo (read-only) instead of
using broken API endpoints. Delete auto-fetches file SHA via
git hash-object for proper API verification.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 08:53:55 +08:00
wqer b9638fe0b6 Delete snippet "hello-cli.go"
CI / test (push) Has been cancelled Details
2026-06-04 08:51:27 +08:00
wqer 1762a24851 Delete snippet "test.py"
CI / test (push) Has been cancelled Details
2026-06-04 08:51:15 +08:00
wqer 5ae0a134bb test
CI / test (push) Failing after 2m6s Details
2026-06-04 08:41:36 +08:00
赵昌 2669c632d0 revert: remove automatic _Sidebar.md management
CI / test (push) Failing after 2m7s Details
Automatic sidebar updates caused wiki rendering issues on the web UI.
The sidebar is best left managed by GitLink's web interface directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 08:21:28 +08:00
赵昌 3ee71a1ffc fix: update _Sidebar.md on wiki page create/delete
CI / test (push) Failing after 2m6s Details
When creating a wiki page, add [[PageName]] to _Sidebar.md.
When deleting a wiki page, remove [[PageName]] from _Sidebar.md.
This ensures the web UI properly reflects page changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 08:11:08 +08:00
赵昌 87277cbf4f feat: add code snippet management shortcut (snippet +list/+view/+create/+delete)
CI / test (push) Failing after 11m14s Details
Store snippets as files in the snippets/ directory of the repository
using the repo file API. Supports language tagging in content format
and branch selection for commits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 21:19:11 +08:00
wqer fef44dc5e3 Add hello snippet via CLI
CI / test (push) Has been cancelled Details
2026-06-03 21:06:13 +08:00