Skip to content

Implement native macOS GUI foundation with structured API helper#129

Closed
jamesyc wants to merge 14 commits into
mainfrom
gui
Closed

Implement native macOS GUI foundation with structured API helper#129
jamesyc wants to merge 14 commits into
mainfrom
gui

Conversation

@jamesyc
Copy link
Copy Markdown
Owner

@jamesyc jamesyc commented May 20, 2026

Implement native macOS GUI foundation with structured API helper

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eec1bcb6ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/timecapsulesmb/app/service.py Outdated
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/BackendClient.swift Outdated
Copy link
Copy Markdown
Contributor

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

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 structured Python backend and a macOS SwiftUI frontend to provide a graphical interface for TimeCapsuleSMB operations. The backend adds a JSON-based API mode for tasks such as device discovery, deployment, and maintenance, while the frontend manages the helper process and event streaming. Review feedback identifies several critical improvements, including resolving a potential deadlock when reading process output, ensuring configuration files are merged rather than overwritten, capturing stderr for better logging, and enhancing error diagnostics with tracebacks.

Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/BackendClient.swift Outdated
Comment thread src/timecapsulesmb/app/service.py Outdated
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/BackendClient.swift Outdated
Comment thread src/timecapsulesmb/app/service.py Outdated
Comment thread src/timecapsulesmb/app/service.py Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 macOS GUI for TimeCapsuleSMB, featuring a SwiftUI application and a new Python-based structured API. The implementation includes a subprocess runner to execute the Python helper and a refactored backend to support event streaming and configuration management. Review feedback highlights the need for more idiomatic Swift Concurrency patterns in the subprocess runner to avoid polling and thread blocking. Additionally, the reviewer identified several locations in the Python operations where unvalidated type conversions of GUI parameters could cause crashes, and recommended updating a deprecated SwiftUI alert API.

Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/HelperRunner.swift Outdated
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/HelperRunner.swift Outdated
Comment thread src/timecapsulesmb/app/operations.py Outdated
Comment thread src/timecapsulesmb/app/operations.py Outdated
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/ContentView.swift Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 structured app backend and a macOS GUI integration for TimeCapsuleSMB. The changes include a new Python-based API helper for structured communication, a Swift-based macOS application, and comprehensive unit tests for both. Feedback provided includes recommendations for localizing user-facing strings in the SwiftUI views, improving UTF-8 decoding safety in the Swift helper runner, implementing input size limits on stdin to prevent potential Denial of Service, and enhancing the jsonable utility to support Enum types.

Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/ContentView.swift
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/HelperRunner.swift Outdated
Comment thread src/timecapsulesmb/app/helper.py Outdated
Comment thread src/timecapsulesmb/services/app.py
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 175195804b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/timecapsulesmb/services/app.py
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/ContentView.swift Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 structured app backend and a macOS GUI for TimeCapsuleSMB, enabling non-interactive integration and a graphical user interface. Key additions include a Swift-based macOS application, a new Python api command for handling structured requests, and updates to existing CLI tools to support JSON output and new operational flags like --no-wait. The review feedback identifies a missing validation for the path parameter in the repair operation and points out unreachable dead code in the SSH configuration logic.

Comment thread src/timecapsulesmb/app/ops/maintenance.py Outdated
Comment thread src/timecapsulesmb/cli/set_ssh.py Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 macOS GUI for TimeCapsuleSMB, implemented in SwiftUI, along with a structured Python backend API to support it. The changes include a new Swift package for the application, a backend client for process communication, and a refactoring of the Python codebase to extract non-interactive service logic shared between the CLI and GUI. Review feedback focused on modernizing file reading in the Swift helper runner to avoid deprecated APIs, improving event summary logic to prefer backend-provided text, and ensuring consistency in the JSON contract field names. Additionally, expanding the sensitive data redaction list was recommended to improve security.

Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/HelperRunner.swift Outdated
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/HelperRunner.swift
Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/Models.swift
Comment thread src/timecapsulesmb/app/contracts.py Outdated
Comment thread src/timecapsulesmb/app/events.py Outdated
Comment thread src/timecapsulesmb/app/ops/maintenance.py Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 macOS GUI application for managing TimeCapsuleSMB, including the necessary Swift Package Manager configuration, backend client logic, SwiftUI views, and helper utilities. It also updates the Python backend to support structured API requests and event streaming. My review identified a concurrency issue in the BackendClient where the run operation is incorrectly isolated to the MainActor, which would block the UI. I have provided a code suggestion to detach the task and correctly dispatch UI updates back to the main actor.

Comment thread macos/TimeCapsuleSMB/Sources/TimeCapsuleSMBApp/BackendClient.swift Outdated
jamesyc added 2 commits May 20, 2026 05:33
…firmations, credential separation, cancellability state, and Swift confirmation handling
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 macOS GUI for TimeCapsuleSMB, implemented in Swift, along with a structured Python backend API to support it. The changes include a comprehensive Swift codebase for the app's frontend, logic for locating and running the Python helper, and a new api command in the Python CLI that communicates via NDJSON. Additionally, existing CLI logic has been refactored into shared services to ensure consistency between the CLI and GUI. Feedback from the reviewer focuses on improving type safety and maintainability in the Python backend by adding specific type hints and corresponding imports to several functions in the deployment and runtime service modules.

Comment thread src/timecapsulesmb/app/ops/deploy.py
Comment thread src/timecapsulesmb/app/ops/deploy.py Outdated
Comment thread src/timecapsulesmb/app/ops/deploy.py Outdated
Comment thread src/timecapsulesmb/app/ops/deploy.py Outdated
Comment thread src/timecapsulesmb/services/runtime.py Outdated
Comment thread src/timecapsulesmb/services/runtime.py Outdated
@jamesyc
Copy link
Copy Markdown
Owner Author

jamesyc commented May 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

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

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 structured app backend and a macOS SwiftUI application to provide a GUI for TimeCapsuleSMB. It refactors core CLI logic into shared services and implements an NDJSON-based API helper for communication between the GUI and the Python backend. Key additions include a new confirmation flow for risky operations and a --no-wait flag for reboot cycles. Feedback was provided to ensure the configure operation requires user confirmation before enabling SSH via ACP, preventing unexpected device reboots.

Comment thread src/timecapsulesmb/app/ops/configure.py
@jamesyc jamesyc closed this May 20, 2026
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