Skip to content

ghintegration#1

Merged
DemonicEgg merged 1 commit intoclaudesdkfrom
opencode/DispatchTUI-githubintegration
Apr 6, 2026
Merged

ghintegration#1
DemonicEgg merged 1 commit intoclaudesdkfrom
opencode/DispatchTUI-githubintegration

Conversation

@DemonicEgg
Copy link
Copy Markdown
Owner

No description provided.

Shows <leader>esc dashboard hint before variants/agents/commands in the session view bottom-right keybinding hints.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@DemonicEgg DemonicEgg marked this pull request as draft April 6, 2026 00:07
@DemonicEgg DemonicEgg marked this pull request as ready for review April 6, 2026 00:12
@DemonicEgg DemonicEgg changed the base branch from dev to claudesdk April 6, 2026 00:16
@DemonicEgg DemonicEgg merged commit b0503e9 into claudesdk Apr 6, 2026
@DemonicEgg
Copy link
Copy Markdown
Owner Author

Review findings — b0503e9


Bug #1 (Critical): PRCell is non-reactive in SolidJS

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — PRCell component (~line 131)

SolidJS component functions run once at mount — they do not re-run when props change. The early if (props.pr === "error") and if (!props.pr) return <></> checks run only at creation time. If props.pr is undefined at mount (which it will be, since PR data loads asynchronously), the component permanently returns <></> and never updates. The derived const p, num, state, ci, rev, label are also stale forever.

Fix: Replace early returns with <Switch>/<Match> or <Show>, and compute derived values inside createMemo or inline JSX.


Issue #2 (AGENTS.md): Unnecessary destructuring in experimental.ts

File: packages/opencode/src/server/routes/experimental.ts — GET /github/pr handler (~line 499)

const { branch, cwd } = c.req.valid("query") — both values are each used exactly once. Per AGENTS.md: "Avoid unnecessary destructuring. Use dot notation to preserve context." Should be const query = c.req.valid("query") and query.branch / query.cwd.


Issue #3 (AGENTS.md): Unnecessary destructuring + inline violation in experimental.ts

File: packages/opencode/src/server/routes/experimental.ts — POST /github/pr/merge handler (~line 561)

const { number } = c.req.valid("json") — single-field destructure used exactly once. Violates both the destructuring rule and "Reduce total variable count by inlining when a value is only used once." Should be c.req.valid("json").number passed directly.

@AndyChinViolet
Copy link
Copy Markdown

Review findings — b0503e9


Issue #1 (AGENTS.md): else block in propose()

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — lines 629–634

The terminal if (pr && pr !== "error") { ... } else { ... } violates AGENTS.md: "Avoid else statements. Prefer early returns." Since there is no code after the block, the success branch can return early and the error toast falls through naturally.


Issue #2 (AGENTS.md): else block in merge()

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — lines 681–686

Same pattern: terminal if (merged) { ... } else { ... }. Same rule: "Avoid else statements. Prefer early returns."


Issue #3 (AGENTS.md): for loop over array in worktrees()

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — lines 332–334

for (const agent of flat()) iterates over an array using a for loop. Violates: "Prefer functional array methods (flatMap, filter, map) over for loops." Should use .reduce() or .filter()/.map() to build the Map.


Issue #4 (AGENTS.md): for loop over Map in fetchPRs()

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — lines 340–345

for (const [branch, dir] of worktrees()) iterates over a Map with a for loop. Same rule. Could use Array.from(worktrees()).forEach(...) or [...worktrees()].forEach(...).


Issue #5 (AGENTS.md): sep and dir each used once in ghFetch

File: packages/opencode/src/cli/cmd/tui/routes/home.tsx — lines 312–314

Both const sep and const dir are declared and used exactly once in the immediately following template literal. Violates: "Reduce total variable count by inlining when a value is only used once."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants