Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"alpha": "0.140",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Medium. This alpha went from 0.080 to 0.140 in 95b0bfd, after the screenshots (213ae5e, whose colorset is still 0.080) and after the contrast numbers were measured from them. The PR says 95b0bfd wasn't rebuilt on the Mac. So the "after" shots don't show the light tint this PR ships, and the 11.0:1 / 3.6:1 / "about 4.7:1" figures were taken against a lighter background than the head draws. Fix: rebuild the head, retake dark and light shots (this Mac's window and a machine's, per #873), and re-measure the foot's second line and the lists' secondary captions on them.


Generated by Claude Code

"blue": "0.403922",
"green": "0.227451",
"red": "0.168627"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"alpha": "0.550",
"blue": "0.403922",
"green": "0.227451",
"red": "0.168627"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
5 changes: 5 additions & 0 deletions apple/Sources/Ganymede/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ struct ContentView: View {
) { path in
openWindow(value: EditorRequest(path: path, place: place))
}
// The navy glass (#873): a pale navy, or the navy itself in
// the dark, over the system's sidebar material and through the
// whole column. The lists hide their own background so this
// shows behind their rows.
.background(Color("SidebarTint").ignoresSafeArea())
// A restarted server has a new address and token.
.id(place.isMachine ? model.serverURL : nil)
} else {
Expand Down
84 changes: 49 additions & 35 deletions apple/Sources/Ganymede/NativeChrome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct FolderSidebar: View {
}
}
.listStyle(.sidebar)
.scrollContentBackground(.hidden)
.modifier(SidebarKeys(
selection: selection,
isExpanded: { actions.isExpanded($0.url).wrappedValue },
Expand Down Expand Up @@ -348,9 +349,13 @@ private struct FolderContents: View {
.accessibilityHint(canOpen ? "" : "Can't open here")
.accessibilityAction { if canOpen { actions.open(entry) } }
.padding(.vertical, 1)
// The open notebook's row, in a quiet grey (#873), so it
// doesn't read as a second selection beside the
// system's own, which keeps the accent while the list
// has focus.
.listRowBackground(
entry.serverPath == actions.openPath
? Color.accentColor.opacity(0.18) : Color.clear
? Color.primary.opacity(0.08) : Color.clear
)
.contextMenu { menu(for: entry) }
.tag(entry)
Expand Down Expand Up @@ -458,6 +463,7 @@ struct RunningList: View {
}
}
.listStyle(.sidebar)
.scrollContentBackground(.hidden)
// The page asks the server for each kernel's memory only while
// the list shows (#241).
.onAppear { page.watchMemory(true) }
Expand Down Expand Up @@ -507,24 +513,34 @@ private struct KernelRow: View {
}
}

/// The foot of the navigator sidebar (#246): where kernels run, and how
/// many kernels and terminals there are. A menu: open a terminal on a
/// remote, manage remotes. Where kernels run (#473) is an advanced choice
/// in the kernel menu now (#701); connected machines are places instead.
struct ServerLine: View {
var page: PageModel
/// The foot of the navigator sidebar (#873): the window's folder, named, and
/// where it is, over a menu: show it in the Finder, open a terminal on a
/// remote, manage remotes. Where kernels run (#473) is an advanced choice in
/// the kernel menu and the kernel button's popover now (#701, #867), and how
/// many run is in the Running tab and that popover: the foot is the project.
struct ProjectLine: View {
/// The window's folder: this Mac's own, or a machine's as its server
/// reports it (#740).
let folder: URL
/// This Mac's home folder, for the "~" in the line under the name; nil
/// for a machine's window, whose home this isn't.
var home: URL?
/// "This Mac", or the machine's name (#740).
let placeName: String
/// Whether the folder is on this Mac: only then can the menu show it in
/// the Finder, which lists this Mac's disk.
var showsInFinder = true
/// The window's bottom panel, for terminals on remotes.
var panel: PanelController?
/// A connected machine's name, for its window (#740): the kernels run
/// there, not where this device's setting says.
var machineName: String?
var model = AppModel.shared
var terminals = OpenTerminals.shared

var body: some View {
let locations = model.kernelLocations
let location = machineName ?? locations.title
let lines = ProjectLineText.lines(folder: folder, home: home, placeName: placeName)
Menu {
if showsInFinder {
Button("Show in Finder") { NSWorkspace.shared.activateFileViewerSelecting([folder]) }
Divider()
}
let remotes = model.remotes.filter { $0.hasServer || $0.ssh != nil }
if let panel, !remotes.isEmpty {
Section("New Terminal On") {
Expand All @@ -537,47 +553,45 @@ struct ServerLine: View {
}
}
}
Divider()
}
Divider()
Button(locations.hasRemotes ? "Manage Remotes…" : "Add a Remote…") {
Button(model.kernelLocations.hasRemotes ? "Manage Remotes…" : "Add a Remote…") {
SettingsOpener.show(.remotes)
}
} label: {
HStack(spacing: 6) {
Circle()
.fill(page.state.backend == nil ? Color.secondary : Color("Ready"))
.frame(width: 7, height: 7)
.accessibilityHidden(true)
Image(systemName: machineName == nil && locations.selected == nil ? "laptopcomputer" : "server.rack")
Image(systemName: "folder")
.foregroundStyle(.secondary)
.accessibilityHidden(true)
Text(location)
.lineLimit(1)
VStack(alignment: .leading, spacing: 1) {
Text(lines.title)
.font(.callout)
.lineLimit(1)
Text(lines.detail)
.font(.caption)
// Not `.secondary`, which measured 3.6:1 on the
// light tint (#873): this keeps it past 4.5:1.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Medium (with the colorset comment). "keeps it past 4.5:1" isn't measured: the dev log gives "about 4.7:1 by the same arithmetic", worked from screenshots at the 8% light tint, and the head's tint is 14%. 4.7 leaves little margin, so it needs a measurement from a build of this commit. Separately, #873 item 1 says "Text keeps 4.5:1 (secondary labels included)", and the dev log says the lists' .secondary captions (Recents' folders) land at about 3.6:1 in light. That item is neither met nor deferred to a named issue. Either raise those captions the same way as this line, or file a follow-up (or put it to Thomas, as with the focused selection) and name it in the PR.


Generated by Claude Code

.foregroundStyle(Color.primary.opacity(0.72))
.lineLimit(1)
.truncationMode(.middle)
}
Spacer(minLength: 4)
Image(systemName: "chevron.up.chevron.down")
.font(.system(size: 8, weight: .semibold))
.foregroundStyle(.secondary)
.accessibilityHidden(true)
Spacer(minLength: 4)
Text(OpenTerminals.summary(kernels: page.state.sessions.count, terminals: terminals.entries.count))
.foregroundStyle(.secondary)
.lineLimit(1)
}
.font(.caption)
.padding(.horizontal, 10)
.padding(.vertical, 6)
.contentShape(Rectangle())
}
.menuStyle(.button)
.buttonStyle(.plain)
.menuIndicator(.hidden)
.help(helpText(locations))
.accessibilityLabel("Kernels run on \(location)")
}

private func helpText(_ locations: KernelLocations) -> String {
var text = "Kernels run on \(machineName ?? locations.title)."
if page.state.backend == nil { text += " Not connected." }
return text + (machineName == nil ? " Click to open a terminal on a remote." : "")
// The whole path, for the line under the name, which is cut short.
.help(folder.path)
.accessibilityLabel(lines.title)
.accessibilityValue(lines.detail)
}
}

Expand Down
Loading
Loading