Files
terminalX/apps/TerminalX/iOS/AppRouter.swift
kid 5d1abdc7ac feat: 修复终端换行错乱根因 + 顶带重设计 + 移除移动端分屏
- 换行错乱根因:tmux 客户端格子改以 ghostty 实测为权威(像素除法
  偏大 1 行/列 → 远端按更宽排版、本地自动换行掉字符),单 pane 实测
  格子直发 refresh-client;kickoff 用 raw surface 真实格子;顶栏
  格子数 tmux 模式读 clientGrid(模拟器连本机 sshd 端到端验证)
- 顶带落地为真实 chrome 行:✕/⌄ 独立按钮组 + 弱化标题 +
  TmuxWindowTabGroup window tab 组,pane 不再被悬浮胶囊遮内容
- 放弃移动端分屏:删 SplitMenu/分屏入口,tmux window 切换上移顶部
  tab,侧边栏改列活动会话;底部动作条合并状态行
- Info.plist 补 NSLocalNetworkUsageDescription(LAN 直连必需,
  缺失时 socket 静默超时)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 11:11:20 +08:00

81 lines
3.0 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import SwiftUI
/// 稿
///
/// **** / route
/// surface `SessionCanvas` ContentView
enum AppRoute: Equatable {
case home
case terminal(UUID)
var sessionID: UUID? {
if case .terminal(let id) = self { return id }
return nil
}
}
///
enum SidebarState: Equatable {
/// 56pt
case collapsed
/// 288pt resize
case pinned
var isExpanded: Bool { self == .pinned }
///
var layoutWidth: CGFloat {
switch self {
case .collapsed: TX.Layout.railWidth
case .pinned: TX.Layout.sidebarWidth
}
}
}
/// router `@State`W URL
///
enum AppModal: Equatable {
/// 3c
case closeConfirm
}
///
@MainActor
final class AppRouter: ObservableObject {
@Published var route: AppRoute = .home
@Published var sidebar: SidebarState = .collapsed
///
@Published var modal: AppModal?
/// `TX.Motion.standard`稿 200260ms easeOut
///
/// ** / / 线** `transition`
/// 退 ""
/// router URL
private func animated(_ change: () -> Void) {
withAnimation(TX.Motion.standard, change)
}
/// / /
func enter(_ sessionID: UUID) {
animated { route = .terminal(sessionID) }
}
/// H /
func goHome() {
animated {
modal = nil
route = .home
}
}
/// \ / Logo /
func toggleSidebar() {
animated { sidebar = sidebar == .collapsed ? .pinned : .collapsed }
}
/// /W URL
func present(_ modal: AppModal) { animated { self.modal = modal } }
func dismissModal() { animated { modal = nil } }
}