Skip to content
Merged
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
Expand Up @@ -27,6 +27,14 @@ public nonisolated struct NewTabWidgetSettings: Sendable, Equatable {
public var weatherCity = NewTabWidgetSettings.weatherCityDefault
/// The machines a chat can start on, each with its color, icon and online state.
public var machines = NewTabWidgetSettings.machinesDefault
/// A quiet local clock beside the composer.
public var clock = NewTabWidgetSettings.clockDefault
/// A small elapsed-time stopwatch beside the composer.
public var timer = NewTabWidgetSettings.timerDefault
/// The original time-of-day greeting wording.
public var warmGreeting = NewTabWidgetSettings.warmGreetingDefault
/// A bundled public-domain quote that changes daily.
public var quote = NewTabWidgetSettings.quoteDefault
/// The movable widgets in the order the page shows them (`tabs.newTabWidgets.order`,
/// NewTabWidgetEdits.swift), every one of ``movable`` once.
public var order = NewTabWidgetSettings.movable
Expand All @@ -38,8 +46,9 @@ public nonisolated struct NewTabWidgetSettings: Sendable, Equatable {
/// own row under the composer, not moved by the edit mode).
public var ids: [String] {
let on = ["greeting": greeting, "projects": projects, "actions": actions, "chats": chats, "styleDots": styleDots,
"weather": weather, "machines": machines]
return (["greeting"] + order + ["styleDots", "weather", "machines"]).filter { on[$0] == true }
"weather": weather, "machines": machines, "clock": clock, "timer": timer,
"warmGreeting": warmGreeting, "quote": quote]
return (["greeting"] + order + ["styleDots", "weather", "machines", "clock", "timer", "warmGreeting", "quote"]).filter { on[$0] == true }
}

static func parse(_ root: JSONValue, diagnostics: inout [SettingsDiagnostic]) -> Self {
Expand All @@ -58,6 +67,10 @@ public nonisolated struct NewTabWidgetSettings: Sendable, Equatable {
settings.weatherCity = value.trimmingCharacters(in: .whitespacesAndNewlines)
}
if let value = reader.bool("machines") { settings.machines = value }
if let value = reader.bool("clock") { settings.clock = value }
if let value = reader.bool("timer") { settings.timer = value }
if let value = reader.bool("warmGreeting") { settings.warmGreeting = value }
if let value = reader.bool("quote") { settings.quote = value }
diagnostics += reader.diagnostics
settings.order = parseOrder(root, diagnostics: &diagnostics)
return settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ extension NewTabWidgetSettings {
/// `tabs.newTabWidgets.machines`: Off by default. On: each machine the composer can start a chat on (this Mac, SSH and cloud peers) with its color, its icon and whether it is online.
public nonisolated static let machinesPath = ["tabs", "newTabWidgets", "machines"]
public nonisolated static let machinesDefault = false
/// `tabs.newTabWidgets.clock`: Off by default. On: a quiet local time display beside the composer.
public nonisolated static let clockPath = ["tabs", "newTabWidgets", "clock"]
public nonisolated static let clockDefault = false
/// `tabs.newTabWidgets.timer`: Off by default. On: a small elapsed-time stopwatch beside the composer.
public nonisolated static let timerPath = ["tabs", "newTabWidgets", "timer"]
public nonisolated static let timerDefault = false
/// `tabs.newTabWidgets.warmGreeting`: Off by default. On: a time-of-day greeting such as Good afternoon.
public nonisolated static let warmGreetingPath = ["tabs", "newTabWidgets", "warmGreeting"]
public nonisolated static let warmGreetingDefault = false
/// `tabs.newTabWidgets.quote`: Off by default. On: a bundled public-domain quote, changing daily.
public nonisolated static let quotePath = ["tabs", "newTabWidgets", "quote"]
public nonisolated static let quoteDefault = false
}

/// One group of `SettingsSchema` rows (its own type: the schema type's line budget is per type).
Expand Down Expand Up @@ -114,6 +126,46 @@ nonisolated enum NewTabWidgetSettingsSchema {
default: .bool(NewTabWidgetSettings.machinesDefault),
keywords: ["new tab", "widget", "machines", "computers", "ssh", "cloud", "online"]
),
SettingDescriptor(
NewTabWidgetSettings.clockPath,
section: .general,
group: group,
title: SettingsText.keyed("settings.tabs.newTabWidgets.clock", "Show Clock on New Tab"),
help: SettingsText.keyed("settings.tabs.newTabWidgets.clock.help", "A quiet local time display beside the composer."),
kind: .toggle,
default: .bool(NewTabWidgetSettings.clockDefault),
keywords: ["new tab", "widget", "clock", "time"]
),
SettingDescriptor(
NewTabWidgetSettings.timerPath,
section: .general,
group: group,
title: SettingsText.keyed("settings.tabs.newTabWidgets.timer", "Show Stopwatch on New Tab"),
help: SettingsText.keyed("settings.tabs.newTabWidgets.timer.help", "A small elapsed-time stopwatch beside the composer."),
kind: .toggle,
default: .bool(NewTabWidgetSettings.timerDefault),
keywords: ["new tab", "widget", "timer", "stopwatch"]
),
SettingDescriptor(
NewTabWidgetSettings.warmGreetingPath,
section: .general,
group: group,
title: SettingsText.keyed("settings.tabs.newTabWidgets.warmGreeting", "Show Warm Greeting on New Tab"),
help: SettingsText.keyed("settings.tabs.newTabWidgets.warmGreeting.help", "A time-of-day greeting such as Good afternoon."),
kind: .toggle,
default: .bool(NewTabWidgetSettings.warmGreetingDefault),
keywords: ["new tab", "widget", "greeting", "time of day"]
),
SettingDescriptor(
NewTabWidgetSettings.quotePath,
section: .general,
group: group,
title: SettingsText.keyed("settings.tabs.newTabWidgets.quote", "Show Quote of the Day on New Tab"),
help: SettingsText.keyed("settings.tabs.newTabWidgets.quote.help", "A bundled public-domain quote, changing daily."),
kind: .toggle,
default: .bool(NewTabWidgetSettings.quoteDefault),
keywords: ["new tab", "widget", "quote", "daily"]
),
]
}
}
155 changes: 147 additions & 8 deletions schemas/settings/source/new-tab-widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "headline", "greeting", "project", "question"]
"keywords": [
"new tab",
"widget",
"headline",
"greeting",
"project",
"question"
]
},
{
"key": "tabs.newTabWidgets.projects",
Expand All @@ -38,7 +45,14 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "project", "folder", "machine", "environment"]
"keywords": [
"new tab",
"widget",
"project",
"folder",
"machine",
"environment"
]
},
{
"key": "tabs.newTabWidgets.actions",
Expand All @@ -53,7 +67,14 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "actions", "new terminal", "new browser tab", "new chat"]
"keywords": [
"new tab",
"widget",
"actions",
"new terminal",
"new browser tab",
"new chat"
]
},
{
"key": "tabs.newTabWidgets.chats",
Expand All @@ -68,7 +89,14 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "chats", "recent", "history", "all chats"]
"keywords": [
"new tab",
"widget",
"chats",
"recent",
"history",
"all chats"
]
},
{
"key": "tabs.newTabWidgets.styleDots",
Expand All @@ -84,7 +112,13 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "template", "style", "dots"]
"keywords": [
"new tab",
"widget",
"template",
"style",
"dots"
]
},
{
"key": "tabs.newTabWidgets.weather",
Expand All @@ -99,7 +133,14 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "weather", "temperature", "forecast", "location"]
"keywords": [
"new tab",
"widget",
"weather",
"temperature",
"forecast",
"location"
]
},
{
"key": "tabs.newTabWidgets.weatherCity",
Expand All @@ -114,7 +155,13 @@
},
"kind": "text",
"default": "",
"keywords": ["new tab", "widget", "weather", "city", "location"]
"keywords": [
"new tab",
"widget",
"weather",
"city",
"location"
]
},
{
"key": "tabs.newTabWidgets.machines",
Expand All @@ -129,7 +176,99 @@
},
"kind": "toggle",
"default": false,
"keywords": ["new tab", "widget", "machines", "computers", "ssh", "cloud", "online"]
"keywords": [
"new tab",
"widget",
"machines",
"computers",
"ssh",
"cloud",
"online"
]
},
{
"key": "tabs.newTabWidgets.clock",
"name": "clock",
"note": "Off by default. On: a quiet local time display beside the composer.",
"title": {
"key": "settings.tabs.newTabWidgets.clock",
"text": "Show Clock on New Tab"
},
"help": {
"key": "settings.tabs.newTabWidgets.clock.help",
"text": "A quiet local time display beside the composer."
},
"kind": "toggle",
"default": false,
"keywords": [
"new tab",
"widget",
"clock",
"time"
]
},
{
"key": "tabs.newTabWidgets.timer",
"name": "timer",
"note": "Off by default. On: a small elapsed-time stopwatch beside the composer.",
"title": {
"key": "settings.tabs.newTabWidgets.timer",
"text": "Show Stopwatch on New Tab"
},
"help": {
"key": "settings.tabs.newTabWidgets.timer.help",
"text": "A small elapsed-time stopwatch beside the composer."
},
"kind": "toggle",
"default": false,
"keywords": [
"new tab",
"widget",
"timer",
"stopwatch"
]
},
{
"key": "tabs.newTabWidgets.warmGreeting",
"name": "warmGreeting",
"note": "Off by default. On: a time-of-day greeting such as Good afternoon.",
"title": {
"key": "settings.tabs.newTabWidgets.warmGreeting",
"text": "Show Warm Greeting on New Tab"
},
"help": {
"key": "settings.tabs.newTabWidgets.warmGreeting.help",
"text": "A time-of-day greeting such as Good afternoon."
},
"kind": "toggle",
"default": false,
"keywords": [
"new tab",
"widget",
"greeting",
"time of day"
]
},
{
"key": "tabs.newTabWidgets.quote",
"name": "quote",
"note": "Off by default. On: a bundled public-domain quote, changing daily.",
"title": {
"key": "settings.tabs.newTabWidgets.quote",
"text": "Show Quote of the Day on New Tab"
},
"help": {
"key": "settings.tabs.newTabWidgets.quote.help",
"text": "A bundled public-domain quote, changing daily."
},
"kind": "toggle",
"default": false,
"keywords": [
"new tab",
"widget",
"quote",
"daily"
]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion web/data/model-catalog/snapshot.json

Large diffs are not rendered by default.

Loading
Loading