Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Feed: Improve placeholder text for empty unsubscribed stream. #29706

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions web/src/narrow_banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,23 @@ function pick_empty_narrow_banner(): NarrowBannerData {
if (can_toggle_narrowed_stream()) {
return {
title: $t({
defaultMessage:
"You aren't subscribed to this stream and nobody has talked about that yet!",
defaultMessage: "There are no messages here.",
}),
// TODO: Consider moving the button to be its own option in the template.
html: $t_html(
{
defaultMessage: "<z-button>Subscribe</z-button>",
defaultMessage:
"Why not <z-link>start the conversation</z-link>? <z-button>Subscribe</z-button>",
},
{
"z-link": (content_html) =>
`<a href="#" class="empty_feed_compose_stream">${content_html.join(
"",
)}</a>`,
"z-button": (content_html) =>
`<button class="button white rounded stream_sub_unsub_button sea-green" type="button" name="subscription">${content_html.join(
`<div class="sub_button_row new-style"><button class="button white rounded stream_sub_unsub_button sea-green" type="button" name="subscription">${content_html.join(
"",
)}</button>`,
)}</button></div>`,
},
),
};
Expand Down
1 change: 1 addition & 0 deletions web/styles/zulip.css
Original file line number Diff line number Diff line change
Expand Up @@ -1946,6 +1946,7 @@ nav {

.sub_button_row {
text-align: center;
margin-top: 15px;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that by this change, margin of subscribe button that toggles subscription in bookend is also affected which seemed like a desirable change to me. I am attaching screenshots for reference. Let me know if we want this change or not.

Before After
image image

}

.small_square_button {
Expand Down
4 changes: 2 additions & 2 deletions web/tests/narrow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You aren't subscribed to this stream and nobody has talked about that yet!",
'translated HTML: <button class="button white rounded stream_sub_unsub_button sea-green" type="button" name="subscription">Subscribe</button>',
"translated: There are no messages here.",
'translated HTML: Why not <a href="#" class="empty_feed_compose_stream">start the conversation</a>? <div class="sub_button_row new-style"><button class="button white rounded stream_sub_unsub_button sea-green" type="button" name="subscription">Subscribe</button></div>',
),
);

Expand Down