mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
ios fixes
This commit is contained in:
parent
e526d18959
commit
91eb87e3ff
3 changed files with 6 additions and 56 deletions
|
|
@ -39,8 +39,7 @@ struct TerminalView: View {
|
||||||
.navigationTitle(session.displayName)
|
.navigationTitle(session.displayName)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar(.visible, for: .bottomBar)
|
.toolbar(.visible, for: .bottomBar)
|
||||||
.toolbarBackground(.visible, for: .bottomBar)
|
.toolbarBackground(.automatic, for: .bottomBar)
|
||||||
.toolbarBackground(Theme.Colors.cardBackground, for: .bottomBar)
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
navigationToolbarItems
|
navigationToolbarItems
|
||||||
bottomToolbarItems
|
bottomToolbarItems
|
||||||
|
|
@ -205,9 +204,6 @@ struct TerminalView: View {
|
||||||
ToolbarItemGroup(placement: .bottomBar) {
|
ToolbarItemGroup(placement: .bottomBar) {
|
||||||
terminalSizeIndicator
|
terminalSizeIndicator
|
||||||
Spacer()
|
Spacer()
|
||||||
connectionStatusIndicator
|
|
||||||
sessionStatusIndicator
|
|
||||||
pidIndicator
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -387,60 +383,13 @@ struct TerminalView: View {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var terminalSizeIndicator: some View {
|
private var terminalSizeIndicator: some View {
|
||||||
if viewModel.terminalCols > 0 && viewModel.terminalRows > 0 {
|
if viewModel.terminalCols > 0 && viewModel.terminalRows > 0 {
|
||||||
HStack(spacing: Theme.Spacing.extraSmall) {
|
Text("\(viewModel.terminalCols)×\(viewModel.terminalRows)")
|
||||||
Image(systemName: "rectangle.split.3x1")
|
.font(Theme.Typography.terminalSystem(size: 11))
|
||||||
.font(.caption)
|
|
||||||
.foregroundColor(Theme.Colors.terminalForeground.opacity(0.5))
|
|
||||||
Text("\(viewModel.terminalCols) × \(viewModel.terminalRows)")
|
|
||||||
.font(Theme.Typography.terminalSystem(size: 12))
|
|
||||||
.foregroundColor(Theme.Colors.terminalForeground.opacity(0.7))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private var connectionStatusIndicator: some View {
|
|
||||||
HStack(spacing: 4) {
|
|
||||||
if viewModel.isConnecting {
|
|
||||||
ProgressView()
|
|
||||||
.progressViewStyle(CircularProgressViewStyle())
|
|
||||||
.scaleEffect(0.5)
|
|
||||||
.frame(width: 12, height: 12)
|
|
||||||
} else {
|
|
||||||
Image(systemName: viewModel.isConnected ? "wifi" : "wifi.slash")
|
|
||||||
.font(.system(size: 10))
|
|
||||||
.foregroundColor(viewModel.isConnected ? Theme.Colors.successAccent : Theme.Colors.errorAccent)
|
|
||||||
}
|
|
||||||
Text(viewModel.isConnecting ? "Connecting" : (viewModel.isConnected ? "Connected" : "Disconnected"))
|
|
||||||
.font(Theme.Typography.terminalSystem(size: 10))
|
|
||||||
.foregroundColor(viewModel.isConnected ? Theme.Colors.successAccent : Theme.Colors.errorAccent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private var sessionStatusIndicator: some View {
|
|
||||||
HStack(spacing: 4) {
|
|
||||||
Circle()
|
|
||||||
.fill(session.isRunning ? Theme.Colors.successAccent : Theme.Colors.terminalForeground.opacity(0.3))
|
|
||||||
.frame(width: 6, height: 6)
|
|
||||||
Text(session.isRunning ? "Running" : "Exited")
|
|
||||||
.font(Theme.Typography.terminalSystem(size: 12))
|
|
||||||
.foregroundColor(session.isRunning ? Theme.Colors.successAccent : Theme.Colors.terminalForeground.opacity(0.5))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var pidIndicator: some View {
|
|
||||||
if let pid = session.pid {
|
|
||||||
Spacer()
|
|
||||||
Text("PID: \(pid)")
|
|
||||||
.font(Theme.Typography.terminalSystem(size: 12))
|
|
||||||
.foregroundColor(Theme.Colors.terminalForeground.opacity(0.5))
|
.foregroundColor(Theme.Colors.terminalForeground.opacity(0.5))
|
||||||
.onTapGesture {
|
|
||||||
UIPasteboard.general.string = String(pid)
|
|
||||||
HapticFeedback.notification(.success)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private var recordingView: some View {
|
private var recordingView: some View {
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Circle()
|
Circle()
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ struct SessionTests {
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
#expect(session.id == "test-123")
|
#expect(session.id == "test-123")
|
||||||
#expect(session.command == "/bin/bash")
|
#expect(session.command == ["/bin/bash"])
|
||||||
#expect(session.workingDir == "/Users/test")
|
#expect(session.workingDir == "/Users/test")
|
||||||
#expect(session.name == "Test Session")
|
#expect(session.name == "Test Session")
|
||||||
#expect(session.status == .running)
|
#expect(session.status == .running)
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ struct APIClientTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test("Handles 401 unauthorized error")
|
@Test("Handles 401 unauthorized error")
|
||||||
|
@MainActor
|
||||||
func handle401Error() async throws {
|
func handle401Error() async throws {
|
||||||
// Arrange
|
// Arrange
|
||||||
MockURLProtocol.requestHandler = { request in
|
MockURLProtocol.requestHandler = { request in
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue