Files
Termind/TFM/Features/AI/SessionContext+Presentation.swift

27 lines
822 B
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.
// SPDX-FileCopyrightText: 2026 Kaede Akino
// SPDX-License-Identifier: GPL-3.0-only
import TermindApplication
import TermindDomain
extension SessionContext {
/// The pinned pills. They carry no `×`: the user's control over this is
/// which pane has focus, not a per-turn checkbox.
var chips: [ContextChip] {
var chips: [ContextChip] = []
if let hostName {
chips.append(ContextChip(kind: .host, label: hostName, content: hostName))
}
if let workingDirectory, showsWorkingDirectoryChip {
chips.append(
ContextChip(
kind: .directory,
label: workingDirectoryDisplayLabel ?? workingDirectory,
content: workingDirectory
))
}
return chips
}
}