Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

misc: Improve app title bar for stream and topic views.

sayamsamal19e292989c10
diff --git a/frontend_tests/puppeteer_tests/drafts.ts b/frontend_tests/puppeteer_tests/drafts.ts
index 3994ac62c87..e0640b79582 100644
--- a/frontend_tests/puppeteer_tests/drafts.ts
+++ b/frontend_tests/puppeteer_tests/drafts.ts
@@ -123,7 +123,7 @@ async function test_restore_message_draft(page: Page): Promise<void> {
});
assert.strictEqual(
await common.get_text_from_selector(page, "title"),
- "tests - Zulip Dev - Zulip",
+ "#all > tests - Zulip Dev - Zulip",
"Didn't narrow to the right topic.",
);
}
diff --git a/frontend_tests/puppeteer_tests/message-basics.ts b/frontend_tests/puppeteer_tests/message-basics.ts
index 8b764c4e608..97bd46ff5f4 100644
--- a/frontend_tests/puppeteer_tests/message-basics.ts
+++ b/frontend_tests/puppeteer_tests/message-basics.ts
@@ -29,7 +29,7 @@ async function expect_verona_stream(page: Page): Promise<void> {
["Verona > other topic", ["verona other topic c"]],
["Verona > test", ["verona test d"]],
]);
- assert.strictEqual(await page.title(), "Verona - Zulip Dev - Zulip");
+ assert.strictEqual(await page.title(), "#Verona - Zulip Dev - Zulip");
}
async function expect_verona_stream_test_topic(page: Page): Promise<void> {
@@ -103,7 +103,7 @@ async function test_navigations_from_home(page: Page): Promise<void> {
await page.click(`#zhome [title='Narrow to stream "Verona"']`);
await expect_verona_stream(page);
- assert.strictEqual(await page.title(), "Verona - Zulip Dev - Zulip");
+ assert.strictEqual(await page.title(), "#Verona - Zulip Dev - Zulip");
await un_narrow(page);
await expect_home(page);
@@ -192,7 +192,7 @@ async function search_tests(page: Page): Promise<void> {
"Verona",
"Stream",
expect_verona_stream,
- "Verona - Zulip Dev - Zulip",
+ "#Verona - Zulip Dev - Zulip",
);
await search_and_check(
@@ -208,7 +208,7 @@ async function search_tests(page: Page): Promise<void> {
"stream:Verona",
"",
expect_verona_stream,
- "Verona - Zulip Dev - Zulip",
+ "#Verona - Zulip Dev - Zulip",
);
await search_and_check(
@@ -216,7 +216,7 @@ async function search_tests(page: Page): Promise<void> {
"stream:Verona topic:test",
"",
expect_verona_stream_test_topic,
- "test - Zulip Dev - Zulip",
+ "#Verona > test - Zulip Dev - Zulip",
);
await search_and_check(
@@ -224,7 +224,7 @@ async function search_tests(page: Page): Promise<void> {
"stream:Verona topic:other+topic",
"",
expect_verona_other_topic,
- "other topic - Zulip Dev - Zulip",
+ "#Verona > other topic - Zulip Dev - Zulip",
);
await search_and_check(
diff --git a/static/js/narrow.js b/static/js/narrow.js
index 5b681a226b6..8ac961338e1 100644
--- a/static/js/narrow.js
+++ b/static/js/narrow.js
@@ -129,10 +129,12 @@ function update_narrow_title(filter) {
// If the operator is something other than "stream", "topic", or
// "is", we shouldn't update the narrow title
if (filter.has_operator("stream")) {
+ const stream_name = filter.operands("stream")[0];
if (filter.has_operator("topic")) {
- set_narrow_title(filter.operands("topic")[0]);
+ const topic_name = filter.operands("topic")[0];
+ set_narrow_title("#" + stream_name + " > " + topic_name);
} else {
- set_narrow_title(filter.operands("stream")[0]);
+ set_narrow_title("#" + stream_name);
}
} else if (filter.has_operator("is")) {
const title = filter.operands("is")[0];