Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 10, 2025

Overview

Adds a comprehensive design document (MOBILE_DESIGN.md) that outlines strategies for deploying the dikuclient on iOS and Android mobile devices while minimizing code changes and running Go code directly on the device with full-screen terminal display.

Important Requirements: This document includes:

  • Standalone installation requirement - users should be able to install DikuClient without needing to install any other programs
  • Floating buttons capability - the app architecture must support overlaying UI buttons on top of the terminal window for fast controls

What's New

This document provides detailed analysis and recommendations for mobile deployment across both platforms:

iOS Deployment (Recommended: Go Mobile + SwiftTerm)

Explores three deployment options and recommends using gomobile to build a native iOS app integrated with the SwiftTerm terminal emulator:

  • Minimal code changes: ~200-300 new lines (no changes to existing code)
  • Full TUI compatibility: Bubble Tea interface works unchanged
  • Native performance: Go code runs directly on device in a PTY
  • Implementation time: 1-2 weeks
  • Distribution: TestFlight or App Store
  • ✅ Satisfies standalone requirement: One app install, no dependencies
  • ✅ Supports floating buttons: SwiftUI ZStack/UIKit layering enables button overlays

The document includes:

  • Detailed architecture diagrams showing component integration with floating buttons layer
  • Code examples for the mobile wrapper layer and floating button implementation
  • Build process with gomobile
  • App Store submission strategy

Android Deployment (Recommended: Native Android App with Go Mobile)

Explores three deployment options and recommends building a native Android app using gomobile with an embedded terminal emulator:

  • Minimal code changes: ~200-300 new lines (shared with iOS mobile wrapper)
  • Full TUI compatibility: All Bubble Tea features supported
  • Native performance: Go code runs directly on device in a PTY
  • Implementation time: 1-2 weeks
  • Distribution: Play Store or sideloading
  • ✅ Satisfies standalone requirement: One app install, no dependencies
  • ✅ Supports floating buttons: Jetpack Compose Box/FrameLayout enables button overlays

The document includes:

  • Architecture diagrams for Android app integration with floating buttons layer
  • Code examples for mobile wrapper (shared with iOS) and floating button implementation
  • Build process with gomobile for Android
  • Play Store submission strategy
  • Terminal emulator library options (Termux library, TerminalView)

Note on Termux: While the Termux approach (Option 1) requires zero code changes and can be implemented in half a day, it has two critical limitations: (1) does not satisfy the standalone requirement because users must first install Termux, and (2) does not support floating buttons as it's a terminal-only environment with no native UI layer. This approach is documented but not recommended given these constraints.

Document Contents

The 1025-line design document covers:

  • Current Architecture Analysis: Overview of existing Go/Bubble Tea/TUI stack
  • Mobile Requirements: Clear specification of deployment goals including standalone installation and floating buttons capability
  • Impact of Requirements: Analysis of what these constraints mean and rule out
  • Multiple Options: 3 deployment strategies per platform with detailed pros/cons, standalone assessments, and floating buttons support evaluation
  • Architecture Diagrams: Visual representation of component integration including floating buttons layer
  • Code Examples: Code blocks showing implementation details including floating button overlays for both platforms
  • Build Automation: GitHub Actions workflow for cross-compilation
  • Distribution Strategies: App store approaches for both platforms
  • Installation Documentation: End-user guides for both platforms
  • Performance Considerations: Battery life, memory usage, network impact
  • Testing Strategy: Device testing plans for both platforms
  • Timeline Estimates: Realistic effort projections (1-2 weeks per platform, 2-3 weeks total if parallel)

Key Principles

Both recommended approaches maintain all core requirements:

  1. Direct Execution: Go code runs natively on the mobile device (not via remote server)
  2. Full-Screen Terminal: Complete terminal emulation with ANSI colors and formatting
  3. Minimal Changes: ~200-300 lines of mobile wrapper code (shared between platforms)
  4. Maintainability: Leverages existing mature libraries (SwiftTerm for iOS, Terminal View for Android)
  5. Standalone Installation: Users install one app, no additional programs needed
  6. Floating Buttons Capability: Native UI frameworks provide view layering for button overlays

Why These Recommendations?

Native Apps for Both Platforms: The standalone installation and floating buttons requirements necessitate native app development for both iOS and Android. While this requires more effort than simpler approaches (like Termux), it provides a professional, consumer-grade user experience where users install one app and can immediately use DikuClient, with full support for future UI enhancements like floating control buttons.

Code Sharing: The mobile wrapper code (~200-300 lines) can be largely shared between iOS and Android platforms, making the combined development effort only 2-3 weeks instead of 4 weeks if done in parallel.

iOS/SwiftTerm: Using gomobile with SwiftTerm provides a native iOS experience while requiring minimal code changes and maintaining full compatibility with the existing Bubble Tea TUI. SwiftUI's ZStack and UIKit's view hierarchy naturally support overlaying floating buttons on the terminal.

Android/Go Mobile: Using gomobile with an embedded terminal emulator (Termux library or TerminalView) provides a native Android experience with the same benefits as iOS. Jetpack Compose's Box and FrameLayout naturally support overlaying floating buttons on the terminal.

Next Steps

This design document provides the foundation for:

  1. Creating shared mobile package with Go mobile integration (1-2 days)
  2. Developing native apps for both platforms in parallel (1-2 weeks each) with floating button layer
  3. Beta testing via TestFlight (iOS) and Internal Testing (Android)
  4. Public releases on App Store and Play Store

The document serves as a complete implementation guide for anyone wanting to deploy dikuclient on mobile platforms with standalone installation and floating buttons support for future enhancements.

Original prompt

Write a design doc MOBILE_DESIGN.md that explains a plan to build the project so that it can be run on iOS and Android, while changing as little code as possible. I'd like the go code to run directly on the mobile device, and displaying to a full-screen terminal on the device. Exactly how to make that happen may involve several options, explore them and recommend the best way for each platform (iOS and Android).


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Add design doc for mobile platform support Add MOBILE_DESIGN.md with comprehensive iOS and Android deployment strategies Oct 10, 2025
Copilot AI requested a review from anicolao October 10, 2025 19:17
Copilot finished work on behalf of anicolao October 10, 2025 19:17
@anicolao
Copy link
Owner

@copilot an important constraint that I missed is that I want the user to be able to install DikuClient and run it and have a working setup. They should not need to install any other program to use the result. Please add an assessment of this constraint to the analysis and if necessary change the recommendation to one that satisfies the constraint.

Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot an important constraint that I missed is that I want the user to be able to install DikuClient and run it and have a working setup. They should not need to install any other program to use ...

I've updated MOBILE_DESIGN.md to satisfy the standalone installation requirement (commit 7c76db2).

Key changes:

  1. Added requirement Implement web session management with GUID-based sessions #7: Standalone installation - users install one app, no other programs needed

  2. Added impact analysis: This constraint rules out Termux (requires installing Termux first) and PWA approaches

  3. Updated Android recommendation: Changed from Option 1 (Termux) to Option 2 (Native App with Go Mobile)

    • Was: 0 code changes, half a day effort
    • Now: ~200-300 lines (shared with iOS), 1-2 weeks effort
  4. All options now assessed against standalone requirement:

    • iOS Native App: ✅ Satisfies
    • Android Native App: ✅ Satisfies
    • Android Termux: ❌ Does NOT satisfy
    • PWA: ❌ Does NOT satisfy
  5. Updated timeline: Both platforms require 1-2 weeks each, but can share ~200-300 lines of mobile wrapper code, making total effort 2-3 weeks if developed in parallel

The document now recommends native apps for both platforms as the only approach that satisfies all constraints including standalone installation.

Copilot finished work on behalf of anicolao October 10, 2025 19:31
@anicolao
Copy link
Owner

@copilot the current recommendation looks good. I missed one more requirement: in future development, the app needs to be able to display buttons overlayed on top of the terminal window for fast controls to control the client. I do not want these buttons to have to be non-overlapping; and it seems likely that it is possible to display them atop the terminal but I want to be sure that the recommended approach allows this to be implemented later. Add "floating buttons" to the requirements and update the document accordingly.

Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot the current recommendation looks good. I missed one more requirement: in future development, the app needs to be able to display buttons overlayed on top of the terminal window for fast contr...

I've updated MOBILE_DESIGN.md to include the floating buttons requirement (commit e40237c).

Key additions:

  1. New requirement Fix per-session user management and full viewport terminal sizing in web mode #8: Floating buttons capability - architecture must support overlaying UI buttons on terminal with potential overlap

  2. Impact analysis section: Explains why native UI frameworks with Z-ordering are needed

  3. Updated architecture diagrams: Both iOS and Android now show "Floating Buttons Layer" overlaid on terminal

  4. Code examples added:

    • iOS: SwiftUI ZStack example showing FloatingButton overlay
    • Android: Jetpack Compose Box example showing FloatingButton overlay
  5. All options assessed for floating buttons support:

    • iOS Native (SwiftTerm): ✅ Fully Supported via ZStack/UIKit layering
    • Android Native: ✅ Fully Supported via Compose Box/FrameLayout
    • Termux: ❌ NOT Supported (terminal-only, no UI layer)
    • PWA: ⚠️ Limited (HTML overlays, non-native)

The recommended native app approaches for both platforms fully support floating buttons through their native UI frameworks, which naturally provide view layering and Z-order control. This allows buttons to be easily overlaid on the terminal view for future fast-control features.

Copilot finished work on behalf of anicolao October 10, 2025 19:44
@anicolao anicolao marked this pull request as ready for review October 10, 2025 20:03
@anicolao anicolao merged commit f4769d3 into main Oct 10, 2025
@anicolao anicolao deleted the copilot/add-mobile-design-document branch October 10, 2025 20:03
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