0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 02:52:01 +08:00
discourse/plugins/chat/assets/stylesheets/common/chat-notices.scss
Renato Atilio 7f90056811
FEATURE: Sticky bar for pinned messages in chat channels (#41091)
Surfaces pinned messages directly in the channel instead of only behind
a side panel. A sticky bar at the top of the message list shows the most
recently pinned message; when several messages are pinned a position
indicator appears and tapping the bar cycles through them, jumping to
each pinned message in the conversation.

<img width="413" height="174" alt="image"
src="https://github.com/user-attachments/assets/f01f38cd-bd4d-4b97-9aa1-354a62cda7d5"
/>

The bar's list icon opens the full pinned-messages panel, replacing the
navbar pinned-messages button, which is removed to declutter the header.
The bar refreshes from the committed pin/unpin message bus events so it
stays in sync as messages are pinned and unpinned.

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2026-08-02 11:40:44 -03:00

58 lines
1.1 KiB
SCSS
Vendored

.chat-notices {
display: flex;
flex-direction: column;
gap: 0.5em;
position: absolute;
top: 0;
z-index: 10;
width: 100%;
.full-page-chat & {
padding-inline: 1rem;
box-sizing: border-box;
top: 2rem;
}
// float notices below the pinned bar only while it's actually visible
.chat-channel:has(.chat-pinned-bar:not(.--dismissed, .--loading)) & {
top: var(--chat-pinned-bar-height);
}
&__notice,
.chat-retention-reminder {
display: flex;
align-items: center;
justify-content: space-between;
background: var(--tertiary-low);
padding: var(--space-2);
color: var(--primary);
min-width: 280px;
margin-left: auto;
margin-right: auto;
gap: 0.25rem;
box-sizing: border-box;
border-radius: var(--d-border-radius);
.chat-drawer-outlet & {
border-radius: 0;
}
&:has(.dismiss-btn) {
padding-right: 0;
}
}
.dismiss-btn {
color: var(--primary-medium);
align-self: flex-start;
.chat-drawer-outlet & {
padding-top: var(--space-half);
}
&:hover,
&:focus {
background: var(--tertiary-medium);
}
}
}