Skip to content

Commit 7ccbb26

Browse files
committed
feat(popup): new -hide_title_bar argument
1 parent 8e6278d commit 7ccbb26

File tree

7 files changed

+89
-43
lines changed

7 files changed

+89
-43
lines changed

Notification Agent Core/Controllers/HelpBuilder.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public final class HelpBuilder {
4747
"-background_panel".yellow(),
4848
"-unmovable".yellow(),
4949
"-disable_quit".yellow(),
50-
"-custom_width".yellow()]
50+
"-custom_width".yellow(),
51+
"-buttonless".yellow(),
52+
"-hide_title_bar".yellow()]
5153
static let bannerArguments: [String] = ["-type".green(),
5254
"-title".yellow(),
5355
"-subtitle".yellow(),
@@ -138,7 +140,8 @@ public final class HelpBuilder {
138140
"\n Flag that make the UI unmovable for the user.\n Example: -unmovable",
139141
"\n Flag that tells the agent to ignore cmd+q shortcut.\n Example: -disable_quit",
140142
"\n A custom width for the UI.\n Example: -custom_width 1000",
141-
"\n Flag that tells the agent to not show any destructive CTA (Button).\n Example: -buttonless"]
143+
"\n Flag that tells the agent to not show any destructive CTA (Button).\n Example: -buttonless",
144+
"\n Flag that tells the agent to not show the title bar.\n Example: -hide_title_bar"]
142145
static let bannerDescriptions: [String] = ["[ banner | alert ]".red() + "\n The UI type of the notification.\n Example: -type banner",
143146
"\n The title of the notification.\n Example: -title \"Title\"",
144147
"\n The subtitle of the notification. It supports MarkDown text.\n Example: -subtitle \"Subtitle\"",

Notification Agent Onboarding UI Tests/NAOUITests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class NAOUITests: XCTestCase {
1414
/// Testing simple Onboarding UI
1515
func testA1Onboarding() throws {
1616
let useCase = """
17-
{"notification":{"retainValues":false,"isMovable":true,"type":"onboarding","mainButton":{"label":"OK","callToActionType":"none","callToActionPayload":""},"barTitle":"IBM Notifier","alwaysOnTop":false,"showSuppressionButton":false,"hideTitleBarButtons":false,"accessoryViews":[],"payload":{"pages":[{"infoSection":{"fields":[{"id":"BE8ACDC6-1159-421E-8ECA-F84B6B6785ED","label":"Some Description Some"},{"id":"4C045585-72C2-428B-B574-F55CF86E5DCA","label":"Some Description Some"},{"id":"EF546A45-64CA-473D-8BEA-4BF18C3D624F","label":"Some Description Some"}]},"topIcon":"square.and.arrow.up","subtitle":"First page's subtitle","title":"First page's title","body":"First page's body"},{"singleChange":true,"infoSection":{"fields":[{"label":"First label only","id":"031F8516-F122-4A7D-A53C-4F41C9A6C86A"},{"id":"9A2DE192-E512-484E-B42B-2215C84A0B97","label":"Second label only"},{"label":"Third label only","id":"B9F441F5-E55D-4C71-B0BC-53347A4CE6A4"}]},"tertiaryButton":{"callToActionPayload":"https:\\/\\/www.google.com","label":"Tertiary","callToActionType":"link"},"title":"Second page's title","body":"Second page's body","primaryButtonLabel":"Some","subtitle":"Second page's subtitle"},{"title":"Third page's title","body":"Third page's body","singleChange":true,"subtitle":"Third page's subtitle"},{"body":"Fourth page's body","subtitle":"Fourth page's subtitle","title":"Fourth page's title"}],"progressBarPayload":"automatic"},"silent":false,"forceLightMode":false,"disableQuit":false,"buttonless":false,"miniaturizable":false,"topicID":"untracked","notificationID":"untracked"},"settings":{"isVerboseModeEnabled":false,"environment":"prod"}}
17+
{"notification":{"retainValues":false,"isMovable":true,"type":"onboarding","mainButton":{"label":"OK","callToActionType":"none","callToActionPayload":""},"barTitle":"IBM Notifier","alwaysOnTop":false,"showSuppressionButton":false,"hideTitleBarButtons":false,"accessoryViews":[],"payload":{"pages":[{"infoSection":{"fields":[{"id":"BE8ACDC6-1159-421E-8ECA-F84B6B6785ED","label":"Some Description Some"},{"id":"4C045585-72C2-428B-B574-F55CF86E5DCA","label":"Some Description Some"},{"id":"EF546A45-64CA-473D-8BEA-4BF18C3D624F","label":"Some Description Some"}]},"topIcon":"square.and.arrow.up","subtitle":"First page's subtitle","title":"First page's title","body":"First page's body"},{"singleChange":true,"infoSection":{"fields":[{"label":"First label only","id":"031F8516-F122-4A7D-A53C-4F41C9A6C86A"},{"id":"9A2DE192-E512-484E-B42B-2215C84A0B97","label":"Second label only"},{"label":"Third label only","id":"B9F441F5-E55D-4C71-B0BC-53347A4CE6A4"}]},"tertiaryButton":{"callToActionPayload":"https:\\/\\/www.google.com","label":"Tertiary","callToActionType":"link"},"title":"Second page's title","body":"Second page's body","primaryButtonLabel":"Some","subtitle":"Second page's subtitle"},{"title":"Third page's title","body":"Third page's body","singleChange":true,"subtitle":"Third page's subtitle"},{"body":"Fourth page's body","subtitle":"Fourth page's subtitle","title":"Fourth page's title"}],"progressBarPayload":"automatic"},"silent":false,"forceLightMode":false,"disableQuit":false,"buttonless":false,"hideTitleBar":false,"miniaturizable":false,"topicID":"untracked","notificationID":"untracked"},"settings":{"isVerboseModeEnabled":false,"environment":"prod"}}
1818
""" // pragma: allowlist-secret
1919
if let useCaseData = useCase.data(using: .utf8) {
2020
let app = XCUIApplication()
@@ -54,7 +54,7 @@ class NAOUITests: XCTestCase {
5454
/// Testing simple Onboarding UI with accessory views.
5555
func testA2Onboarding() throws {
5656
let useCase = """
57-
{"notification":{"retainValues":false,"isMovable":true,"type":"onboarding","mainButton":{"label":"OK","callToActionType":"none","callToActionPayload":""},"barTitle":"IBM Notifier","alwaysOnTop":false,"showSuppressionButton":false,"hideTitleBarButtons":false,"accessoryViews":[],"payload":{"pages":[{"accessoryViews":[[{"type":"image","payload":"https://compote.slate.com/images/697b023b-64a5-49a0-8059-27b963453fb1.gif?crop=780%2C520%2Cx0%2Cy0&width=2200"},{"type":"image","payload":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg"}]],"infoSection":{"fields":[{"id":"BE8ACDC6-1159-421E-8ECA-F84B6B6785ED","label":"Some Description Some"},{"id":"4C045585-72C2-428B-B574-F55CF86E5DCA","label":"Some Description Some"},{"id":"EF546A45-64CA-473D-8BEA-4BF18C3D624F","label":"Some Description Some"}]},"topIcon":"square.and.arrow.up","subtitle":"First page's subtitle","title":"First page's title","body":"First page's body"},{"singleChange":true,"infoSection":{"fields":[{"label":"First label only","id":"031F8516-F122-4A7D-A53C-4F41C9A6C86A"},{"id":"9A2DE192-E512-484E-B42B-2215C84A0B97","label":"Second label only"},{"label":"Third label only","id":"B9F441F5-E55D-4C71-B0BC-53347A4CE6A4"}]},"tertiaryButton":{"callToActionPayload":"https:\\/\\/www.google.com","label":"Tertiary","callToActionType":"link"},"title":"Second page's title","body":"Second page's body","primaryButtonLabel":"Some","subtitle":"Second page's subtitle"},{"title":"Third page's title","body":"Third page's body","singleChange":true,"subtitle":"Third page's subtitle"},{"body":"Fourth page's body","subtitle":"Fourth page's subtitle","title":"Fourth page's title"}],"progressBarPayload":"automatic"},"silent":false,"forceLightMode":false,"disableQuit":false,"buttonless":false,"miniaturizable":false,"topicID":"untracked","notificationID":"untracked"},"settings":{"isVerboseModeEnabled":false,"environment":"prod"}}
57+
{"notification":{"retainValues":false,"isMovable":true,"type":"onboarding","mainButton":{"label":"OK","callToActionType":"none","callToActionPayload":""},"barTitle":"IBM Notifier","alwaysOnTop":false,"showSuppressionButton":false,"hideTitleBarButtons":false,"accessoryViews":[],"payload":{"pages":[{"accessoryViews":[[{"type":"image","payload":"https://compote.slate.com/images/697b023b-64a5-49a0-8059-27b963453fb1.gif?crop=780%2C520%2Cx0%2Cy0&width=2200"},{"type":"image","payload":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg"}]],"infoSection":{"fields":[{"id":"BE8ACDC6-1159-421E-8ECA-F84B6B6785ED","label":"Some Description Some"},{"id":"4C045585-72C2-428B-B574-F55CF86E5DCA","label":"Some Description Some"},{"id":"EF546A45-64CA-473D-8BEA-4BF18C3D624F","label":"Some Description Some"}]},"topIcon":"square.and.arrow.up","subtitle":"First page's subtitle","title":"First page's title","body":"First page's body"},{"singleChange":true,"infoSection":{"fields":[{"label":"First label only","id":"031F8516-F122-4A7D-A53C-4F41C9A6C86A"},{"id":"9A2DE192-E512-484E-B42B-2215C84A0B97","label":"Second label only"},{"label":"Third label only","id":"B9F441F5-E55D-4C71-B0BC-53347A4CE6A4"}]},"tertiaryButton":{"callToActionPayload":"https:\\/\\/www.google.com","label":"Tertiary","callToActionType":"link"},"title":"Second page's title","body":"Second page's body","primaryButtonLabel":"Some","subtitle":"Second page's subtitle"},{"title":"Third page's title","body":"Third page's body","singleChange":true,"subtitle":"Third page's subtitle"},{"body":"Fourth page's body","subtitle":"Fourth page's subtitle","title":"Fourth page's title"}],"progressBarPayload":"automatic"},"silent":false,"forceLightMode":false,"disableQuit":false,"buttonless":false,"hideTitleBar":false,"miniaturizable":false,"topicID":"untracked","notificationID":"untracked"},"settings":{"isVerboseModeEnabled":false,"environment":"prod"}}
5858
""" // pragma: allowlist-secret
5959
if let useCaseData = useCase.data(using: .utf8) {
6060
let app = XCUIApplication()

0 commit comments

Comments
 (0)