Skip to content

codex/wails3#14

Merged
kooksee merged 16 commits into
mainfrom
codex/wails3
Jul 2, 2026
Merged

codex/wails3#14
kooksee merged 16 commits into
mainfrom
codex/wails3

Conversation

@kooksee

@kooksee kooksee commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
  • Document Wails desktop client setup
  • Add desktop task helpers
  • Add desktop module actions to Fastgit console
  • chore: quick update codex/wails3 at 2026-06-29 14:43:40
  • Remove stale desktop frontend build artifacts
  • Remove stale frontend dist asset
  • Remove stale frontend bundle asset
  • Remove generated frontend bundle asset
  • Remove stale frontend dist asset
  • feat(desktop): build repo-centered management ui
  • Remove generated frontend bundle artifact
  • fix(desktop): use system git for ssh remotes
  • feat(desktop): add force sync to remote branch
  • feat(desktop): refactor workspace UI and fix module switch flow
  • docs(desktop): sync progress status and runbook
  • chore(desktop): refresh ui docs and frontend dist artifacts

@kooksee kooksee merged commit 8f97981 into main Jul 2, 2026
2 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new desktop client for fastgit, implemented using Wails v3 and a React frontend, without affecting the existing CLI. Key additions include a Go backend service for repository and GitHub API operations, a React-based user interface with multi-tab support, and corresponding documentation and build tasks. Feedback on these changes highlights several critical issues: a missing embedded icon asset that will cause compilation failures, a potential nil pointer dereference when retrieving remote configurations, and a custom string-to-integer conversion function that should be replaced with the standard library's strconv.Atoi. Additionally, performance improvements are needed to avoid excessive localStorage writes during sidebar resizing, and a race condition in the preview-fetching effect should be resolved to prevent stale data from overwriting the UI state.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread desktop/main.go
Comment on lines +13 to +14
//go:embed assets/fastgit-icon.png
var appIcon []byte

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The embedded file desktop/assets/fastgit-icon.png is referenced via //go:embed assets/fastgit-icon.png but is missing from the repository/PR. This will cause a Go compilation failure: pattern assets/fastgit-icon.png: no matching files found. Please ensure that the icon file is added to the desktop/assets/ directory.

Comment thread desktop/service.go
Comment on lines +146 to +154
remote, err := repo.Remote("origin")
if err != nil || remote == nil || len(remote.Config().URLs) == 0 {
return GitHubAuthStatus{
Configured: true,
Source: source,
Message: "Token 已就绪,但 origin remote 不可用",
}
}
owner, repoName, err := parseGitHubRemote(remote.Config().URLs[0])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a risk of a nil pointer dereference panic when calling remote.Config().URLs on lines 147 and 154. If remote.Config() returns nil (which is checked defensively elsewhere in the codebase, e.g., line 1208), accessing URLs will cause a panic. We should store the configuration in a variable and check if it is nil before accessing its fields.

	remote, err := repo.Remote("origin")
	var remoteCfg *gitconfig.RemoteConfig
	if err == nil && remote != nil {
		remoteCfg = remote.Config()
	}
	if remoteCfg == nil || len(remoteCfg.URLs) == 0 {
		return GitHubAuthStatus{
			Configured: true,
			Source:     source,
			Message:    "Token 已就绪,但 origin remote 不可用",
		}
	}
	owner, repoName, err := parseGitHubRemote(remoteCfg.URLs[0])

Comment thread desktop/service.go
Comment on lines +12 to +13
"sort"
"strings"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Import the standard "strconv" package to replace the custom strconvAtoi implementation with strconv.Atoi.

Suggested change
"sort"
"strings"
"sort"
"strconv"
"strings"

Comment thread desktop/service.go
Comment on lines +598 to +620

func requiredInt(values map[string]string, key, label string) (int, error) {
raw, err := requiredValue(values, key, label)
if err != nil {
return 0, err
}
n, convErr := strconvAtoi(raw)
if convErr != nil {
return 0, fmt.Errorf("%s 不是有效数字", label)
}
return n, nil
}

func strconvAtoi(v string) (int, error) {
var out int
for _, ch := range v {
if ch < '0' || ch > '9' {
return 0, errors.New("invalid number")
}
out = out*10 + int(ch-'0')
}
return out, nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The custom strconvAtoi function lacks integer overflow checks and does not handle negative numbers. Since Go's standard library provides a highly optimized and robust strconv.Atoi function, it is highly recommended to use strconv.Atoi instead of maintaining a custom implementation.

func requiredInt(values map[string]string, key, label string) (int, error) {
	raw, err := requiredValue(values, key, label)
	if err != nil {
		return 0, err
	}
	n, convErr := strconv.Atoi(raw)
	if convErr != nil {
		return 0, fmt.Errorf("%s 不是有效数字", label)
	}
	return n, nil
}

Comment on lines +1451 to +1460
useEffect(() => {
savePrefs({
selectedMenu: state.selectedMenu,
modulePaneWidth: state.modulePaneWidth,
modulePaneCollapsed: state.modulePaneCollapsed,
repoNamespaces: state.repoNamespaces,
selectedRepoPath: state.repoPath,
projectSettings: state.projectSettings,
});
}, [state.modulePaneCollapsed, state.modulePaneWidth, state.projectSettings, state.repoNamespaces, state.repoPath, state.selectedMenu]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The useEffect hook triggers savePrefs (which performs a synchronous localStorage.setItem write with JSON.stringify) on every change of state.modulePaneWidth. Since modulePaneWidth is updated continuously during dragging (on every mousemove event), this will cause significant performance degradation, lag, and high CPU usage. Consider debouncing the savePrefs call or only saving the width to localStorage when the drag operation ends (e.g., on mouseup).

Comment on lines +1196 to +1229

useEffect(() => {
if (!selectedItem || !sourceModule) {
return;
}

if (state.output.actionId === "issue_list") {
const issueId = selectedItem.value ?? selectedItem.primary;
const previewKey = `issue:${issueId}`;
if (lastPreviewKeyRef.current === previewKey && sideDetail?.targetId === issueId) {
return;
}

lastPreviewKeyRef.current = previewKey;
setPreviewingId(selectedItem.id);
void previewAction(sourceModule.id, "issue_view", { id: issueId }).finally(() => {
setPreviewingId((current) => (current === selectedItem.id ? null : current));
});
return;
}

if (state.output.actionId === "pr_list") {
const prID = selectedItem.value ?? selectedItem.primary;
const previewKey = `pr:${prID}`;
if (lastPreviewKeyRef.current === previewKey && (sideDetail?.targetId === `pr-${prID}` || sideDetail?.targetId === prID)) {
return;
}

lastPreviewKeyRef.current = previewKey;
setPreviewingId(selectedItem.id);
void previewAction(sourceModule.id, "pr_view", { id: prID }).finally(() => {
setPreviewingId((current) => (current === selectedItem.id ? null : current));
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a potential race condition in this useEffect when fetching previews. If a user rapidly clicks on different items, multiple asynchronous previewAction requests will be fired. If an older request resolves after a newer one, the global state.output.detail will be overwritten with the older item's details, causing a mismatch where the detail panel shows the wrong item's details or falls back to basic details. To prevent this, consider using an active flag inside the effect to ignore state updates from stale requests when the effect cleans up.

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.

1 participant