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.

message_feed_notice: Redesign message search caution link top notice.

Pratik Chanda96338a983c09
diff --git a/web/src/message_feed_top_notices.ts b/web/src/message_feed_top_notices.ts
index 075b6e30666..36008ddcbf7 100644
--- a/web/src/message_feed_top_notices.ts
+++ b/web/src/message_feed_top_notices.ts
@@ -5,6 +5,7 @@ import * as hash_util from "./hash_util.ts";
import type {MessageList} from "./message_list.ts";
import * as message_lists from "./message_lists.ts";
import * as narrow_state from "./narrow_state.ts";
+import {page_params} from "./page_params.ts";
function show_history_limit_notice(): void {
$(".top-messages-logo").hide();
@@ -26,6 +27,13 @@ function hide_end_of_results_notice(): void {
}
function show_end_of_results_notice(): void {
+ // end-of-results notices are hidden for spectators, so leave the
+ // top-of-feed logo in place for them rather than hiding it and showing
+ // nothing.
+ if (page_params.is_spectator) {
+ return;
+ }
+ $(".top-messages-logo").hide();
$(".all-messages-search-caution").show();
// Set the link to point to this search with streams:public added.
@@ -34,7 +42,7 @@ function show_end_of_results_notice(): void {
assert(narrow_filter !== undefined);
const terms = narrow_filter.terms();
const update_hash = hash_util.search_public_streams_notice_url(terms);
- $(".all-messages-search-caution a.search-shared-history").attr("href", update_hash);
+ $(".all-messages-search-caution .search-shared-history").attr("data-url", update_hash);
}
export function update_top_of_narrow_notices(msg_list: MessageList): void {
diff --git a/web/styles/dark_theme.css b/web/styles/dark_theme.css
index 18d078fe9ac..9ddf36ad94f 100644
--- a/web/styles/dark_theme.css
+++ b/web/styles/dark_theme.css
@@ -215,8 +215,7 @@
opacity: 0.7;
}
- .history-limited-box,
- .all-messages-search-caution {
+ .history-limited-box {
background-color: hsl(0deg 0% 0% / 20%);
}
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index c9a50cc84cb..870b359c1fa 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -195,31 +195,33 @@ p.n-margin {
margin: 0;
}
-.history-limited-box {
- color: hsl(16deg 60% 45%);
- border: 1px solid hsl(16deg 60% 45%);
- box-shadow: 0 0 2px hsl(16deg 60% 45%);
-}
-
.all-messages-search-caution {
- border: 1px solid hsl(192deg 19% 75% / 20%);
- box-shadow: 0 0 2px hsl(192deg 19% 75% / 20%);
+ display: none;
+
+ .all-messages-search-caution-info {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 6px;
+ }
}
-.history-limited-box,
-.all-messages-search-caution {
+.history-limited-box {
border-radius: 4px;
display: none;
- margin: 0 auto 12px;
- padding: 5px;
/* Difference should be 16px to accommodate the icon. */
/* This emulates hanging indent. */
padding-left: 26px;
text-indent: -10px;
+ color: hsl(16deg 60% 45%);
+ border: 1px solid hsl(16deg 60% 45%);
+ box-shadow: 0 0 2px hsl(16deg 60% 45%);
+}
- .all-messages-search-caution-icon {
- margin: 0 3px 0 1px;
- }
+.history-limited-box,
+.all-messages-search-caution {
+ margin: 0 auto 12px;
+ padding: 5px;
& p {
margin: 0;
diff --git a/web/templates/message_feed_errors.hbs b/web/templates/message_feed_errors.hbs
index e8c9e47e738..d7eff41759f 100644
--- a/web/templates/message_feed_errors.hbs
+++ b/web/templates/message_feed_errors.hbs
@@ -9,29 +9,32 @@
{{/tr}}
</p>
</div>
-<div class="all-messages-search-caution hidden-for-spectators" hidden>
- <p>
- <i class="all-messages-search-caution-icon fa fa-exclamation-circle" aria-hidden="true"></i>
- {{#tr}}
- End of results from your
- <z-link>history</z-link>.
- {{#*inline "z-link"}}<a href="/help/search-for-messages#search-shared-history"
- target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
- {{/tr}}
- &nbsp;
- <span>
+<div class="all-messages-search-caution hidden-for-spectators">
+ <div class="all-messages-search-caution-info">
+ <p>
{{#if is_guest}}
{{#tr}}
- Consider <z-link>searching all public channels that you can view</z-link>.
- {{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}}
+ End of results from
+ <z-link>your message history</z-link>. Include messages in your public channels
+ sent when you weren't subscribed?
+ {{#*inline "z-link"}}<a href="/help/search-for-messages#search-shared-history"
+ target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
{{else}}
{{#tr}}
- Consider <z-link>searching all public channels</z-link>.
- {{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}}
+ End of results from
+ <z-link>your message history</z-link>. Include messages in public channels
+ sent when you weren't subscribed?
+ {{#*inline "z-link"}}<a href="/help/search-for-messages#search-shared-history"
+ target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
{{/if}}
- </span>
- </p>
+ </p>
+ <button
+ class="search-shared-history action-button action-button-subtle-neutral"
+ type="button">
+ {{t 'Expand search'}}
+ </button>
+ </div>
</div>
<div class="empty_feed_notice_main"></div>