Skip to content

A platform for community discussion. Free, open, simple.

UX: Make live room page consistent with chat channels (#45149)

chapoi01eb99f0db96
diff --git a/plugins/chat/assets/stylesheets/common/chat-channel-empty-state.scss b/plugins/chat/assets/stylesheets/common/chat-channel-empty-state.scss
index f22dfe6e33d..4e74a7e0ac8 100644
--- a/plugins/chat/assets/stylesheets/common/chat-channel-empty-state.scss
+++ b/plugins/chat/assets/stylesheets/common/chat-channel-empty-state.scss
@@ -1,4 +1,5 @@
-.chat-channel {
+.chat-channel,
+.live-chat {
&.is-empty .chat-messages-scroller {
justify-content: center;
}
diff --git a/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs b/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
index 40d4cd5d2a5..95e3f330314 100644
--- a/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
@@ -23,6 +23,18 @@ export default class LiveRoomSidebarContextMenu extends Component {
return this.liveWebrtc.connectionStateFor(this.room.id) === "connected";
}
+ get onRoomPage() {
+ const currentRoute = this.router.currentRoute;
+ return (
+ currentRoute?.name === "live-room" &&
+ currentRoute?.params?.slug === this.room.slug
+ );
+ }
+
+ get showWidgetToggle() {
+ return this.isConnected && !this.onRoomPage;
+ }
+
@action
openRoomPage() {
this.router.transitionTo("live-room", this.room.slug);
@@ -79,15 +91,17 @@ export default class LiveRoomSidebarContextMenu extends Component {
@item={{dropdown.item}}
@room={{this.room}}
/>
- <dropdown.item>
- <DButton
- class="live-room-sidebar-context-menu__open-page"
- @action={{this.openRoomPage}}
- @icon="expand"
- @label="live.room.open_page"
- @title="live.room.open_page"
- />
- </dropdown.item>
+ {{#unless this.onRoomPage}}
+ <dropdown.item>
+ <DButton
+ class="live-room-sidebar-context-menu__open-page"
+ @action={{this.openRoomPage}}
+ @icon="discourse-expand"
+ @label="live.room.open_page"
+ @title="live.room.open_page"
+ />
+ </dropdown.item>
+ {{/unless}}
<dropdown.item>
<DButton
class="live-room-sidebar-context-menu__room-info"
@@ -128,7 +142,7 @@ export default class LiveRoomSidebarContextMenu extends Component {
/>
</dropdown.item>
{{/if}}
- {{#if this.isConnected}}
+ {{#if this.showWidgetToggle}}
<dropdown.item>
<DButton
class="live-room-sidebar-context-menu__toggle-widget"
@@ -146,6 +160,8 @@ export default class LiveRoomSidebarContextMenu extends Component {
}}
/>
</dropdown.item>
+ {{/if}}
+ {{#if this.isConnected}}
<dropdown.item>
<DButton
class="live-room-sidebar-context-menu__leave-room --danger"
diff --git a/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs b/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
index 6e611465411..6d213c3b4df 100644
--- a/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
@@ -764,7 +764,7 @@ export default class LiveCallWidget extends Component {
<DButton
class="live-call-widget__expand"
@action={{this.expandWidget}}
- @icon="expand"
+ @icon="discourse-expand"
@translatedTitle={{this.expandWidgetTitle}}
/>
{{else}}
@@ -772,7 +772,7 @@ export default class LiveCallWidget extends Component {
<DButton
class="btn-default"
@action={{this.openRoom}}
- @icon="expand"
+ @icon="discourse-expand"
@translatedTitle={{this.openRoomTitle}}
/>
<DMenu
diff --git a/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs b/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
index 90cb2740c73..01439c7c294 100644
--- a/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
@@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
-import { array } from "@ember/helper";
+import { array, fn } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
@@ -9,15 +9,34 @@ import EmojiPicker from "discourse/components/emoji-picker";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { optionalRequire } from "discourse/lib/utilities";
+import DButton from "discourse/ui-kit/d-button";
import DConditionalLoadingSpinner from "discourse/ui-kit/d-conditional-loading-spinner";
+import DEmptyState from "discourse/ui-kit/d-empty-state";
+import dConcatClass from "discourse/ui-kit/helpers/d-concat-class";
import dIcon from "discourse/ui-kit/helpers/d-icon";
import { i18n } from "discourse-i18n";
+const SendButton = <template>
+ <div class="chat-composer-button__wrapper">
+ <button
+ aria-label={{i18n "live.chat.send"}}
+ class="chat-composer-button -send"
+ disabled={{@disabled}}
+ title={{i18n "live.chat.send"}}
+ type="button"
+ {{on "click" @onSend}}
+ >
+ {{dIcon "paper-plane"}}
+ </button>
+ </div>
+</template>;
+
export default class LiveChatPanel extends Component {
@service chat;
@service chatChannelsManager;
@service messageBus;
@service router;
+ @service site;
@tracked loading = true;
@tracked unavailable = false;
@@ -26,6 +45,7 @@ export default class LiveChatPanel extends Component {
@tracked draft = "";
@tracked sending = false;
@tracked hideSkeleton = false;
+ @tracked composerFocused = false;
// Resolved at runtime rather than statically imported: cross-plugin static
// imports aren't resolvable in the compiled plugin bundle and break the
@@ -39,6 +59,9 @@ export default class LiveChatPanel extends Component {
chatSkeleton = optionalRequire(
"discourse/plugins/chat/discourse/components/chat-skeleton"
);
+ chatNavbar = optionalRequire(
+ "discourse/plugins/chat/discourse/components/chat/navbar"
+ );
textareaElement = null;
#sessionPath = null;
@@ -119,6 +142,11 @@ export default class LiveChatPanel extends Component {
this.textareaElement = element;
}
+ @action
+ setComposerFocused(focused) {
+ this.composerFocused = focused;
+ }
+
@action
updateDraft(event) {
this.draft = event.target.value;
@@ -255,36 +283,43 @@ export default class LiveChatPanel extends Component {
<template>
<section
aria-label={{i18n "live.chat.title"}}
- class="live-chat"
+ class={{dConcatClass "live-chat" (if this.unavailable "is-unavailable")}}
{{didInsert this.loadSession}}
>
- <header class="live-chat__header">
- <h2 class="live-chat__title">
- {{i18n "live.chat.title"}}
- </h2>
- {{#if this.canOpenInChat}}
- <button
- aria-label={{i18n "live.chat.open_in_chat"}}
- class="btn btn-transparent btn-icon no-text live-chat__open-in-chat"
- title={{i18n "live.chat.open_in_chat"}}
- type="button"
- {{on "click" this.openInChat}}
- >
- {{dIcon "up-right-from-square"}}
- </button>
- {{/if}}
- {{#if @onClose}}
- <button
- aria-label={{i18n "live.chat.close"}}
- class="btn btn-icon no-text live-chat__close"
- title={{i18n "live.chat.close"}}
- type="button"
- {{on "click" @onClose}}
- >
- {{dIcon "xmark"}}
- </button>
- {{/if}}
- </header>
+ {{#if this.chatNavbar}}
+ <this.chatNavbar as |navbar|>
+ {{#if (and this.site.mobileView @onClose)}}
+ <DButton
+ class="btn-transparent no-text c-navbar__back-button"
+ @action={{@onClose}}
+ @ariaLabel="live.chat.close"
+ @icon="chevron-left"
+ @title="live.chat.close"
+ />
+ {{/if}}
+ <navbar.Title @icon="comment" @title={{i18n "live.chat.title"}} />
+ <navbar.Actions>
+ {{#if this.canOpenInChat}}
+ <DButton
+ class="btn-transparent live-chat__open-in-chat"
+ @action={{this.openInChat}}
+ @ariaLabel="live.chat.open_in_chat"
+ @icon="up-right-from-square"
+ @title="live.chat.open_in_chat"
+ />
+ {{/if}}
+ {{#if (and this.site.desktopView @onClose)}}
+ <DButton
+ class="btn-transparent live-chat__close"
+ @action={{@onClose}}
+ @ariaLabel="live.chat.close"
+ @icon="xmark"
+ @title="live.chat.close"
+ />
+ {{/if}}
+ </navbar.Actions>
+ </this.chatNavbar>
+ {{/if}}
{{! eslint-disable ember/template-no-invalid-interactive }}
<div
@@ -302,50 +337,75 @@ export default class LiveChatPanel extends Component {
<this.chatThread @thread={{thread}} />
{{/each}}
{{else if this.unavailable}}
- <div class="live-chat__empty">
- {{dIcon "far-comment"}}
- <p class="live-chat__empty-title">
- {{i18n "live.chat.unavailable"}}
- </p>
- </div>
+ <DEmptyState
+ @svgContent={{dIcon "comment-slash"}}
+ @title={{i18n "live.chat.unavailable_title"}}
+ >
+ <:tip>
+ <div class="empty-state__tip-text">
+ {{i18n "live.chat.unavailable"}}
+ </div>
+ </:tip>
+ </DEmptyState>
{{else}}
- <div class="live-chat__empty">
- {{dIcon "far-comment"}}
- <p class="live-chat__empty-title">
- {{i18n "live.chat.empty_title"}}
- </p>
- <p class="live-chat__empty-body">
- {{i18n "live.chat.empty_body"}}
- </p>
- </div>
- <footer class="live-chat__composer">
- <div class="live-chat__composer-inner">
- <EmojiPicker
- @btnClass="btn-transparent live-chat__emoji"
- @context="live-chat"
- @didSelectEmoji={{this.insertEmoji}}
- />
- <textarea
- aria-label={{i18n "live.chat.composer_placeholder"}}
- class="live-chat__input"
- placeholder={{i18n "live.chat.composer_placeholder"}}
- rows="1"
- {{didInsert this.registerTextarea}}
- {{on "input" this.updateDraft}}
- {{on "keydown" this.onKeydown}}
- ></textarea>
- <button
- aria-label={{i18n "live.chat.send"}}
- class="btn btn-transparent btn-icon no-text live-chat__send"
- disabled={{this.sendDisabled}}
- title={{i18n "live.chat.send"}}
- type="button"
- {{on "click" this.sendFirstMessage}}
- >
- {{dIcon "paper-plane"}}
- </button>
+ <DEmptyState
+ @svgContent={{dIcon "d-chat"}}
+ @title={{i18n "live.chat.empty_title"}}
+ >
+ <:tip>
+ <div class="empty-state__tip-text">
+ {{i18n "live.chat.empty_body"}}
+ </div>
+ </:tip>
+ </DEmptyState>
+ <div class="chat-composer__wrapper --live">
+ <div
+ aria-label={{i18n "chat.aria_roles.composer"}}
+ class={{dConcatClass
+ "chat-composer is-enabled"
+ (if this.composerFocused "is-focused")
+ (if this.sending "is-sending")
+ (if this.sendDisabled "is-send-disabled" "is-send-enabled")
+ }}
+ role="region"
+ >
+ <div class="chat-composer__outer-container">
+ <div class="chat-composer__inner-container">
+ <div class="chat-composer__input-container">
+ <textarea
+ aria-label={{i18n "live.chat.composer_placeholder"}}
+ class="chat-composer__input"
+ placeholder={{i18n "live.chat.composer_placeholder"}}
+ rows="1"
+ {{didInsert this.registerTextarea}}
+ {{on "input" this.updateDraft}}
+ {{on "keydown" this.onKeydown}}
+ {{on "focusin" (fn this.setComposerFocused true)}}
+ {{on "focusout" (fn this.setComposerFocused false)}}
+ ></textarea>
+ </div>
+ {{#if this.site.desktopView}}
+ <EmojiPicker
+ @btnClass="chat-composer-button btn-transparent --emoji"
+ @context="live-chat"
+ @didSelectEmoji={{this.insertEmoji}}
+ />
+ <div class="chat-composer-separator"></div>
+ <SendButton
+ @disabled={{this.sendDisabled}}
+ @onSend={{this.sendFirstMessage}}
+ />
+ {{/if}}
+ </div>
+ {{#if this.site.mobileView}}
+ <SendButton
+ @disabled={{this.sendDisabled}}
+ @onSend={{this.sendFirstMessage}}
+ />
+ {{/if}}
+ </div>
</div>
- </footer>
+ </div>
{{/if}}
</div>
</section>
diff --git a/plugins/live/assets/javascripts/discourse/components/live/room-header.gjs b/plugins/live/assets/javascripts/discourse/components/live/room-header.gjs
new file mode 100644
index 00000000000..9992c412fed
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/components/live/room-header.gjs
@@ -0,0 +1,124 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { optionalRequire } from "discourse/lib/utilities";
+import DButton from "discourse/ui-kit/d-button";
+import dIcon from "discourse/ui-kit/helpers/d-icon";
+import { i18n } from "discourse-i18n";
+import roomIcon, { roomBadge } from "../../lib/live/room-icon.js";
+import LiveRoomInfoModal from "../modal/live-room-info.gjs";
+import LiveRecordingBadge from "./recording-badge.gjs";
+import LiveTranscriptBadge from "./transcript-badge.gjs";
+
+const RoomMeta = <template>
+ <LiveRecordingBadge @room={{@room}} />
+ <LiveTranscriptBadge @room={{@room}} />
+ {{#if @participantCountLabel}}
+ <span class="live-room-header__participants">
+ {{@participantCountLabel}}
+ </span>
+ {{/if}}
+</template>;
+
+const RoomTitle = <template>
+ <div class="live-room-header__title">
+ <h1 class="live-room-header__name">
+ <span class="live-room-header__icon">
+ {{dIcon @icon}}
+ {{#if @badge}}
+ {{dIcon @badge class="live-room-header__restricted-icon"}}
+ {{/if}}
+ </span>
+ <DButton
+ class="btn-transparent live-room-header__info-trigger"
+ @action={{@onOpenInfo}}
+ @translatedLabel={{@room.name}}
+ />
+ </h1>
+ <RoomMeta
+ @participantCountLabel={{@participantCountLabel}}
+ @room={{@room}}
+ />
+ </div>
+</template>;
+
+const RoomActions = <template>
+ {{#if @canOpenChat}}
+ <DButton
+ class="btn-transparent live-room-header__open-chat"
+ @action={{@onOpenChat}}
+ @ariaLabel="live.chat.open"
+ @icon="comment"
+ @title="live.chat.open"
+ />
+ {{/if}}
+</template>;
+
+export default class LiveRoomHeader extends Component {
+ @service modal;
+
+ chatNavbar = optionalRequire(
+ "discourse/plugins/chat/discourse/components/chat/navbar"
+ );
+
+ get icon() {
+ return roomIcon(this.args.room);
+ }
+
+ get badge() {
+ return roomBadge(this.args.room);
+ }
+
+ get participantCountLabel() {
+ const count = this.args.room.active_participants?.length;
+ if (!count) {
+ return null;
+ }
+ return i18n("live.room_page.participant_count", { count });
+ }
+
+ @action
+ openRoomInfo() {
+ this.modal.show(LiveRoomInfoModal, { model: { room: this.args.room } });
+ }
+
+ <template>
+ <header class="live-room-header">
+ {{#if this.chatNavbar}}
+ <this.chatNavbar as |navbar|>
+ <RoomTitle
+ @badge={{this.badge}}
+ @icon={{this.icon}}
+ @onOpenInfo={{this.openRoomInfo}}
+ @participantCountLabel={{this.participantCountLabel}}
+ @room={{@room}}
+ />
+ <navbar.Actions>
+ <RoomActions
+ @canOpenChat={{@canOpenChat}}
+ @onOpenChat={{@onOpenChat}}
+ @room={{@room}}
+ />
+ </navbar.Actions>
+ </this.chatNavbar>
+ {{else}}
+ <div class="live-room-header__fallback">
+ <RoomTitle
+ @badge={{this.badge}}
+ @icon={{this.icon}}
+ @onOpenInfo={{this.openRoomInfo}}
+ @participantCountLabel={{this.participantCountLabel}}
+ @room={{@room}}
+ />
+ <div class="live-room-header__actions">
+ <RoomActions
+ @canOpenChat={{@canOpenChat}}
+ @onOpenChat={{@onOpenChat}}
+ @room={{@room}}
+ />
+ </div>
+ </div>
+ {{/if}}
+ </header>
+ </template>
+}
diff --git a/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs b/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
index 1abd384e8ad..70b4172a56f 100644
--- a/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
@@ -35,10 +35,9 @@ import LiveCallControls from "./call-controls.gjs";
import LiveCallSubmenu from "./call-submenu.gjs";
import LiveCaptionOverlay from "./caption-overlay.gjs";
import LiveChatPanel from "./chat-panel.gjs";
-import LiveRecordingBadge from "./recording-badge.gjs";
import LiveRingingTile from "./ringing-tile.gjs";
+import LiveRoomHeader from "./room-header.gjs";
import LiveSpeakQueue from "./speak-queue.gjs";
-import LiveTranscriptBadge from "./transcript-badge.gjs";
import LiveVideoTile from "./video-tile.gjs";
const ROOM_MENU = "live-room-menu";
@@ -251,8 +250,8 @@ export default class LiveRoomPage extends Component {
return this.chatOpen && this.joined && this.chatAvailable;
}
- get chatToggleTitle() {
- return this.chatOpen ? i18n("live.chat.close") : i18n("live.chat.open");
+ get canOpenChat() {
+ return this.joined && this.chatAvailable && !this.chatVisible;
}
get chatRendered() {
@@ -425,8 +424,8 @@ export default class LiveRoomPage extends Component {
}
@action
- toggleChat() {
- this.setChatOpen(!this.chatOpen);
+ openChat() {
+ this.setChatOpen(true);
}
@action
@@ -476,15 +475,15 @@ export default class LiveRoomPage extends Component {
}
@action
- dockAndClose(closeMenu) {
+ toggleFullscreenFromMenu(closeMenu) {
+ this.toggleGridFullscreen();
closeMenu?.();
- this.dockRoom();
}
@action
- toggleChatFromMenu(closeMenu) {
+ dockAndClose(closeMenu) {
closeMenu?.();
- this.toggleChat();
+ this.dockRoom();
}
@action
@@ -564,269 +563,256 @@ export default class LiveRoomPage extends Component {
{{didInsert this.autoJoinIfRequested}}
{{didUpdate this.reconcileSpotlight this.participants}}
>
- <div class="live-room-page__body">
- <div class="live-room-page__main">
- <header class="live-room-page__header">
- <div class="live-room-page__title-row">
- <h1 class="live-room-page__title">{{this.room.name}}</h1>
- <LiveRecordingBadge @room={{this.room}} />
- <LiveTranscriptBadge @room={{this.room}} />
- </div>
- {{#if this.room.description_excerpt}}
- <p class="live-room-page__description">
- {{this.room.description_excerpt}}
- </p>
- {{/if}}
- </header>
-
- <div class="live-room-page__stage">
- {{#if this.tiles.length}}
- {{#if this.presentationLayout}}
- <div class="live-room-page__presentation">
- <div class="live-room-page__presentation-main">
- <LiveVideoTile
- @isSelf={{this.presentationTile.isSelf}}
- @onAspect={{this.reportTileAspect}}
- @onSpotlight={{this.toggleSpotlight}}
- @participant={{this.presentationTile.participant}}
- @room={{this.room}}
- @showVideo={{this.presentationTile.showVideo}}
- @spotlighted={{this.presentationTile.spotlighted}}
- />
- </div>
- {{#if
- (or
- this.presentationRailTiles.length
- this.ringingEntries.length
- )
- }}
- <div class="live-room-page__presentation-rail">
- {{#each
- this.presentationRailTiles key="participant.id"
- as |tile|
- }}
- <LiveVideoTile
- @isSelf={{tile.isSelf}}
- @onAspect={{this.reportTileAspect}}
- @onSpotlight={{this.toggleSpotlight}}
- @participant={{tile.participant}}
- @room={{this.room}}
- @showVideo={{tile.showVideo}}
- @spotlighted={{tile.spotlighted}}
- />
- {{/each}}
- {{#each this.ringingEntries key="user.id" as |entry|}}
- <LiveRingingTile @user={{entry.user}} />
- {{/each}}
- </div>
- {{/if}}
- </div>
- {{else}}
- <div
- class="live-room-page__grid"
- style={{this.gridStyle}}
- {{didInsert this.registerGrid}}
- {{this.trackGridSize this.updateGridSize}}
- {{this.trackFullscreen this.setGridFullscreen}}
- >
- <button
- aria-label={{this.gridFullscreenTitle}}
- class="btn btn-icon no-text live-room-page__fullscreen"
- title={{this.gridFullscreenTitle}}
- type="button"
- {{on "click" this.toggleGridFullscreen}}
- >
- {{dIcon (if this.gridFullscreen "compress" "expand")}}
- </button>
-
- {{#each this.tiles key="participant.id" as |tile|}}
- <LiveVideoTile
- @isSelf={{tile.isSelf}}
- @onAspect={{this.reportTileAspect}}
- @onSpotlight={{this.toggleSpotlight}}
- @participant={{tile.participant}}
- @room={{this.room}}
- @showVideo={{tile.showVideo}}
- @spotlighted={{tile.spotlighted}}
- />
- {{/each}}
- {{#each this.ringingEntries key="user.id" as |entry|}}
- <LiveRingingTile @user={{entry.user}} />
- {{/each}}
+ <div class="live-room-page__main">
+ <LiveRoomHeader
+ @canOpenChat={{this.canOpenChat}}
+ @onOpenChat={{this.openChat}}
+ @room={{this.room}}
+ />
+
+ <div class="live-room-page__stage">
+ {{#if this.tiles.length}}
+ {{#if this.presentationLayout}}
+ <div class="live-room-page__presentation">
+ <div class="live-room-page__presentation-main">
+ <LiveVideoTile
+ @isSelf={{this.presentationTile.isSelf}}
+ @onAspect={{this.reportTileAspect}}
+ @onSpotlight={{this.toggleSpotlight}}
+ @participant={{this.presentationTile.participant}}
+ @room={{this.room}}
+ @showVideo={{this.presentationTile.showVideo}}
+ @spotlighted={{this.presentationTile.spotlighted}}
+ />
</div>
- {{/if}}
+
+ {{#if
+ (or
+ this.presentationRailTiles.length this.ringingEntries.length
+ )
+ }}
+ <div class="live-room-page__presentation-rail">
+ {{#each
+ this.presentationRailTiles key="participant.id"
+ as |tile|
+ }}
+ <LiveVideoTile
+ @isSelf={{tile.isSelf}}
+ @onAspect={{this.reportTileAspect}}
+ @onSpotlight={{this.toggleSpotlight}}
+ @participant={{tile.participant}}
+ @room={{this.room}}
+ @showVideo={{tile.showVideo}}
+ @spotlighted={{tile.spotlighted}}
+ />
+ {{/each}}
+ {{#each this.ringingEntries key="user.id" as |entry|}}
+ <LiveRingingTile @user={{entry.user}} />
+ {{/each}}
+ </div>
+ {{/if}}
+ </div>
{{else}}
- <div class="live-room-page__empty">
- {{i18n "live.room_page.empty"}}
+ <div
+ class="live-room-page__grid"
+ style={{this.gridStyle}}
+ {{didInsert this.registerGrid}}
+ {{this.trackGridSize this.updateGridSize}}
+ {{this.trackFullscreen this.setGridFullscreen}}
+ >
+ {{#if this.gridFullscreen}}
+ <DButton
+ class="btn-icon no-text live-room-page__fullscreen"
+ @action={{this.toggleGridFullscreen}}
+ @icon="discourse-compress"
+ @translatedAriaLabel={{this.gridFullscreenTitle}}
+ @translatedTitle={{this.gridFullscreenTitle}}
+ />
+ {{/if}}
+ {{#each this.tiles key="participant.id" as |tile|}}
+ <LiveVideoTile
+ @isSelf={{tile.isSelf}}
+ @onAspect={{this.reportTileAspect}}
+ @onSpotlight={{this.toggleSpotlight}}
+ @participant={{tile.participant}}
+ @room={{this.room}}
+ @showVideo={{tile.showVideo}}
+ @spotlighted={{tile.spotlighted}}
+ />
+ {{/each}}
+ {{#each this.ringingEntries key="user.id" as |entry|}}
+ <LiveRingingTile @user={{entry.user}} />
+ {{/each}}
</div>
{{/if}}
- {{#if this.joined}}
- <LiveCaptionOverlay @room={{this.room}} />
- {{/if}}
+ {{else}}
+ <div class="live-room-page__empty">
+ {{i18n "live.room_page.empty"}}
+ </div>
+ {{/if}}
+ {{#if this.joined}}
+ <LiveCaptionOverlay @room={{this.room}} />
+ {{/if}}
- <footer class="live-room-page__controls">
- {{#if this.joined}}
- <LiveCallControls @room={{this.room}} />
- {{#if this.isStageRoom}}
- <DMenu
- @ariaLabel={{i18n "live.stage.queue_title"}}
- @identifier="live-speak-queue-menu"
- @modalForMobile={{true}}
- @placement="top-end"
- @title={{i18n "live.stage.queue_title"}}
- @triggerClass="btn-default live-speak-queue-trigger"
- >
- <:trigger>
- {{dIcon "list-ol"}}
- {{#if this.speakQueueCount}}
- <span
- class="live-speak-queue-trigger__count"
- >{{this.speakQueueCount}}</span>
- {{/if}}
- </:trigger>
- <:content>
- <LiveSpeakQueue @room={{this.room}} />
- </:content>
- </DMenu>
- {{/if}}
+ <footer class="live-room-page__controls">
+ {{#if this.joined}}
+ <LiveCallControls @room={{this.room}} />
+ {{#if this.isStageRoom}}
<DMenu
- @ariaLabel={{i18n "live.room.more"}}
- @icon="ellipsis-vertical"
- @identifier="live-room-menu"
+ @ariaLabel={{i18n "live.stage.queue_title"}}
+ @identifier="live-speak-queue-menu"
@modalForMobile={{true}}
@placement="top-end"
- @title={{i18n "live.room.more"}}
- @triggerClass="btn-default"
+ @title={{i18n "live.stage.queue_title"}}
+ @triggerClass="btn-default live-speak-queue-trigger"
>
- <:content as |roomMenu|>
- <DDropdownMenu as |dropdown|>
- <LiveInviteAgentButton
- @closeMenu={{roomMenu.close}}
- @item={{dropdown.item}}
- @room={{this.room}}
+ <:trigger>
+ {{dIcon "list-ol"}}
+ {{#if this.speakQueueCount}}
+ <span
+ class="live-speak-queue-trigger__count"
+ >{{this.speakQueueCount}}</span>
+ {{/if}}
+ </:trigger>
+ <:content>
+ <LiveSpeakQueue @room={{this.room}} />
+ </:content>
+ </DMenu>
+ {{/if}}
+ <DMenu
+ @ariaLabel={{i18n "live.room.more"}}
+ @icon="ellipsis-vertical"
+ @identifier="live-room-menu"
+ @modalForMobile={{true}}
+ @placement="top-end"
+ @title={{i18n "live.room.more"}}
+ @triggerClass="btn-default"
+ >
+ <:content as |roomMenu|>
+ <DDropdownMenu as |dropdown|>
+ <LiveInviteAgentButton
+ @closeMenu={{roomMenu.close}}
+ @item={{dropdown.item}}
+ @room={{this.room}}
+ />
+ <dropdown.item>
+ <DButton
+ class="btn-transparent live-room-page__layout-trigger"
+ @action={{this.openLayoutMenu}}
+ @forwardEvent={{true}}
+ @icon={{this.layoutIcon}}
+ @label="live.room.layout"
+ @suffixIcon="angle-right"
/>
- {{#if this.chatAvailable}}
- <dropdown.item>
- <DButton
- class="btn-transparent"
- @action={{fn
- this.toggleChatFromMenu
- roomMenu.close
- }}
- @icon={{if
- this.chatVisible
- "comment-slash"
- "far-comment"
- }}
- @translatedLabel={{this.chatToggleTitle}}
- />
- </dropdown.item>
- {{/if}}
+ </dropdown.item>
+ <dropdown.item>
+ <DButton
+ class="btn-transparent"
+ @action={{fn this.dockAndClose roomMenu.close}}
+ @icon="picture-in-picture"
+ @label="live.room.widget_mode"
+ />
+ </dropdown.item>
+ {{#if (and this.tiledLayout this.tiles.length)}}
<dropdown.item>
<DButton
- class="btn-transparent live-room-page__layout-trigger"
- @action={{this.openLayoutMenu}}
- @forwardEvent={{true}}
- @icon={{this.layoutIcon}}
- @label="live.room.layout"
- @suffixIcon="angle-right"
+ class="btn-transparent live-room-page__fullscreen-trigger"
+ @icon="discourse-expand"
+ @translatedLabel={{this.gridFullscreenTitle}}
+ {{on
+ "click"
+ (fn this.toggleFullscreenFromMenu roomMenu.close)
+ }}
/>
</dropdown.item>
+ {{/if}}
+ {{#if this.room.can_invite}}
<dropdown.item>
<DButton
class="btn-transparent"
- @action={{fn this.dockAndClose roomMenu.close}}
- @icon="compress"
- @label="live.room.widget_mode"
+ @action={{fn this.openInviteModal roomMenu.close}}
+ @icon="user-plus"
+ @label="live.invite.menu"
/>
</dropdown.item>
- {{#if this.room.can_invite}}
- <dropdown.item>
- <DButton
- class="btn-transparent"
- @action={{fn this.openInviteModal roomMenu.close}}
- @icon="user-plus"
- @label="live.invite.menu"
- />
- </dropdown.item>
- {{/if}}
- {{#if this.transcriptAvailable}}
+ {{/if}}
+ {{#if this.transcriptAvailable}}
+ <dropdown.item>
+ <DButton
+ class={{dConcatClass
+ "btn-transparent live-room-page__transcript-toggle"
+ (if this.transcribing "--recording")
+ }}
+ @action={{fn
+ this.toggleTranscriptFromMenu
+ roomMenu.close
+ }}
+ @icon={{if
+ this.transcribing
+ "stop"
+ "closed-captioning"
+ }}
+ @translatedLabel={{this.transcriptToggleTitle}}
+ />
+ </dropdown.item>
+ {{#if this.transcriptDraftable}}
<dropdown.item>
<DButton
- class={{dConcatClass
- "btn-transparent live-room-page__transcript-toggle"
- (if this.transcribing "--recording")
- }}
+ class="btn-transparent live-room-page__transcript-draft"
@action={{fn
- this.toggleTranscriptFromMenu
+ this.draftTranscriptTopic
roomMenu.close
}}
- @icon={{if
- this.transcribing
- "stop"
- "closed-captioning"
- }}
- @translatedLabel={{this.transcriptToggleTitle}}
+ @icon="far-file-lines"
+ @translatedLabel={{this.transcriptDraftLabel}}
/>
</dropdown.item>
- {{#if this.transcriptDraftable}}
- <dropdown.item>
- <DButton
- class="btn-transparent live-room-page__transcript-draft"
- @action={{fn
- this.draftTranscriptTopic
- roomMenu.close
- }}
- @icon="far-file-lines"
- @translatedLabel={{this.transcriptDraftLabel}}
- />
- </dropdown.item>
- {{/if}}
{{/if}}
- <dropdown.item>
- <DButton
- class="btn-transparent"
- @action={{fn this.openRoomInfo roomMenu.close}}
- @icon="circle-info"
- @label="live.room.info"
- />
- </dropdown.item>
- </DDropdownMenu>
- </:content>
- </DMenu>
- <DButton
- class="btn-danger live-room-page__leave"
- @action={{this.leaveRoom}}
- @icon="phone-slash"
- @label="live.room.leave"
- />
- {{else}}
- <DButton
- class="btn-primary live-room-page__join"
- @action={{this.joinRoom}}
- @disabled={{this.connecting}}
- @icon="phone"
- @isLoading={{this.connecting}}
- @label="live.room.join"
- />
- {{/if}}
- </footer>
- </div>
+ {{/if}}
+ <dropdown.item>
+ <DButton
+ class="btn-transparent"
+ @action={{fn this.openRoomInfo roomMenu.close}}
+ @icon="circle-info"
+ @label="live.room.info"
+ />
+ </dropdown.item>
+ </DDropdownMenu>
+ </:content>
+ </DMenu>
+ <DButton
+ class="btn-danger live-room-page__leave"
+ @action={{this.leaveRoom}}
+ @icon="phone-slash"
+ @label="live.room.leave"
+ />
+ {{else}}
+ <DButton
+ class="btn-primary live-room-page__join"
+ @action={{this.joinRoom}}
+ @disabled={{this.connecting}}
+ @icon="phone"
+ @isLoading={{this.connecting}}
+ @label="live.room.join"
+ />
+ {{/if}}
+ </footer>
</div>
-
- {{#if this.chatRendered}}
- <aside
- class={{dConcatClass
- "live-room-page__sidebar"
- (if this.chatClosing "--closing")
- }}
- {{on "animationend" this.chatAnimationEnded}}
- >
- <LiveChatPanel @onClose={{this.closeChat}} @room={{this.room}} />
- </aside>
- {{/if}}
</div>
+
+ {{#if this.chatRendered}}
+ <aside
+ class={{dConcatClass
+ "chat-side-panel"
+ (if this.chatClosing "--closing")
+ }}
+ {{on "animationend" this.chatAnimationEnded}}
+ >
+ <LiveChatPanel @onClose={{this.closeChat}} @room={{this.room}} />
+ </aside>
+ {{/if}}
+
</section>
</template>
}
diff --git a/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs b/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
index b5f123a1af7..d98991160f9 100644
--- a/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
@@ -223,7 +223,9 @@ export default class LiveVideoTile extends Component {
type="button"
{{on "click" this.toggleFullscreen}}
>
- {{dIcon (if this.isFullscreen "compress" "expand")}}
+ {{dIcon
+ (if this.isFullscreen "discourse-compress" "discourse-expand")
+ }}
</button>
{{/if}}
</div>
diff --git a/plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js b/plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js
index bdbadefca6d..df45c4e2ff6 100644
--- a/plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js
@@ -15,7 +15,7 @@ export function toggleFullscreen(element, { fallbackVideo = false } = {}) {
return;
}
- if (fullscreenElement()) {
+ if (fullscreenElement() === element) {
(document.exitFullscreen || document.webkitExitFullscreen)?.call(document);
return;
}
diff --git a/plugins/live/assets/javascripts/discourse/templates/live-room.gjs b/plugins/live/assets/javascripts/discourse/templates/live-room.gjs
index 97691643748..798284021ef 100644
--- a/plugins/live/assets/javascripts/discourse/templates/live-room.gjs
+++ b/plugins/live/assets/javascripts/discourse/templates/live-room.gjs
@@ -1,6 +1,9 @@
+import bodyClass from "discourse/helpers/body-class";
import LiveRoomPage from "discourse/plugins/live/discourse/components/live/room-page";
export default <template>
+ {{bodyClass "has-full-page-chat"}}
+
<LiveRoomPage
@autoJoin={{@controller.join}}
@dockOnJoin={{@controller.dockOnJoin}}
diff --git a/plugins/live/assets/stylesheets/common/live-chat.scss b/plugins/live/assets/stylesheets/common/live-chat.scss
index cf59ed74fdd..9762884720f 100644
--- a/plugins/live/assets/stylesheets/common/live-chat.scss
+++ b/plugins/live/assets/stylesheets/common/live-chat.scss
@@ -1,49 +1,21 @@
+@use "lib/viewport";
+
+@include viewport.until(sm) {
+ #main-outlet-wrapper {
+ .has-full-page-chat & {
+ padding: 0;
+ }
+ }
+}
+
.live-chat {
- // border-box so the 22rem min-width (set by the room sidebar) includes the
- // borders — content-box would make the panel 2px wider than the sidebar,
- // whose overflow: hidden then clips the right border off.
- box-sizing: border-box;
display: flex;
- flex: 1;
flex-direction: column;
min-height: 0;
width: 100%;
overflow: hidden;
- border: 1px solid var(--primary-low);
- border-radius: 0.75rem;
background: var(--secondary);
-
- &__header {
- display: flex;
- align-items: center;
- gap: var(--space-2);
- padding: var(--space-2) var(--space-3);
- border-block-end: 1px solid var(--primary-low);
- }
-
- &__title {
- margin: 0;
- font-size: var(--font-0);
- font-weight: 600;
- }
-
- &__open-in-chat {
- margin-inline-start: auto;
- }
-
- &__close {
- margin-inline-start: auto;
-
- // The chat toggle in the room's control bar is the close affordance; only
- // the narrow-viewport layout needs an X of its own, because there the
- // panel becomes a drawer overlaying that control bar. Breakpoint matches
- // the sidebar drawer in live-room-page.scss.
- display: none;
-
- @media (width <= 1000px) {
- display: inline-flex;
- }
- }
+ height: 100%;
&__body {
display: flex;
@@ -86,69 +58,51 @@
}
}
- &__empty {
+ .empty-state__container {
margin: auto;
- padding: var(--space-4);
- text-align: center;
- color: var(--primary-medium);
+ }
+}
+// chat component overrules
+.empty-state {
+ .live-chat & {
.d-icon {
- font-size: 2rem;
- color: var(--primary-low-mid);
+ color: var(--tertiary);
}
}
- &__empty-title {
- margin: var(--space-2) 0 var(--space-1);
- color: var(--primary-high);
- font-weight: 600;
- }
-
- &__empty-body {
- margin: 0;
- font-size: var(--font-down-1);
+ .is-unavailable.live-chat & {
+ .d-icon {
+ color: var(--danger);
+ }
}
+}
- // Only the session's very first message goes through this starter composer;
- // once the thread exists the native chat composer replaces it.
- &__composer {
- padding: var(--space-2) var(--space-3);
- border-block-start: 1px solid var(--primary-low);
- }
+.chat-composer {
+ .live-chat:not(:has(.chat-replying-indicator-container)) & {
+ &__wrapper {
+ margin-bottom: var(--space-4);
+ }
- &__composer-inner {
- display: flex;
- align-items: flex-end;
- gap: var(--space-1);
- border: 1px solid var(--d-chat-input-border-color);
- border-radius: var(--d-border-radius-large);
- background: var(--d-chat-input-bg-color);
-
- &:focus-within {
- box-shadow: var(--d-chat-input-focused-shadow);
+ &__inner-container {
+ padding-inline-start: var(--space-4);
}
}
- &__input {
- flex: 1;
- min-width: 0;
- max-height: 8rem;
- margin: 0;
- padding: var(--space-2) 0;
- border: 0;
- background: transparent;
- line-height: 1.3;
- resize: none;
-
- // The wrapper's focus-within shadow is the focus indicator (matching
- // chat's own composer), not core's default textarea outline.
- &:focus {
- outline: none;
+ &__wrapper {
+ &.--live {
+ @include viewport.until(sm) {
+ margin-left: var(--space-4);
+ }
}
}
+}
- &__send {
- flex: 0 0 auto;
+.c-navbar__title-text {
+ .live-chat & {
+ .d-icon {
+ color: var(--primary-high);
+ }
}
}
diff --git a/plugins/live/assets/stylesheets/common/live-room-page.scss b/plugins/live/assets/stylesheets/common/live-room-page.scss
index 21d1d73feb1..c465e5c6167 100644
--- a/plugins/live/assets/stylesheets/common/live-room-page.scss
+++ b/plugins/live/assets/stylesheets/common/live-room-page.scss
@@ -24,7 +24,6 @@ $live-widget-z: z("header") + 1;
// a content-driven box would chase its own layout.
height: min(21rem, 60vh);
padding: var(--space-3);
- border: 1px solid var(--primary-low);
border-radius: 0.75rem;
background: var(--secondary);
box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 20%);
@@ -237,57 +236,26 @@ html.discourse-touch .live-call-widget {
}
.live-room-page {
- display: flex;
- flex-direction: column;
- gap: 1em;
-
- // A definite height (not just a floor) so the flex chain below actually
- // constrains: without it a transiently oversized video tile stretches the
- // whole page and pushes the control bar below the fold.
- height: calc(100dvh - var(--header-offset, 4em) - 6em);
-
- &__title-row {
- display: flex;
- align-items: center;
- gap: 0.75em;
- min-width: 0;
- }
-
- &__title {
- margin: 0;
- }
-
- &__description {
- margin: 0;
- color: var(--primary-high);
- overflow-wrap: anywhere;
- }
-
- // The video column and the chat sidebar sit side by side; the column flexes
- // and the sidebar takes a fixed width. min-height: 0 lets the grid and the
- // chat message list scroll instead of pushing the page taller.
- &__body {
- flex: 1;
- min-height: 0;
- display: flex;
- gap: var(--space-4);
- }
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ height: calc(100dvh - var(--main-outlet-offset, 4em));
+ min-height: 0;
+ border-right: 1px solid var(--content-border-color);
&__main {
- flex: 1;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
- gap: var(--space-4);
}
- &__sidebar {
- flex: 0 0 22rem;
+ .chat-side-panel {
width: 22rem;
+ min-width: 0;
min-height: 0;
display: flex;
overflow: hidden;
+ border-inline-start: 1px solid var(--content-border-color);
// Animating the width (not just fading in place) makes the whole layout
// ease — the video column and controls resize smoothly instead of
@@ -311,12 +279,6 @@ html.discourse-touch .live-call-widget {
}
}
- &__chat-toggle {
- &.--active {
- color: var(--tertiary);
- }
- }
-
// Meet-style column: the video grid fills the space with tiles centered,
// and the control bar sits on the bottom row, level with the chat panel's
// composer next door.
@@ -325,7 +287,9 @@ html.discourse-touch .live-call-widget {
min-height: 0;
display: flex;
flex-direction: column;
- row-gap: 0.75em;
+ row-gap: var(--space-3);
+ margin: var(--space-2);
+ margin-block-end: var(--space-4);
}
&__presentation {
@@ -401,11 +365,15 @@ html.discourse-touch .live-call-widget {
&:fullscreen {
background: #000;
padding: 0.5em;
+
+ .live-video-tile__menu {
+ display: none;
+ }
}
}
// Top-left so it never collides with the per-tile fullscreen buttons
- // (top-right). Visible in fullscreen too, since it lives inside the grid.
+ // (top-right).
&__fullscreen {
position: absolute;
inset-block-start: 0.35em;
@@ -456,6 +424,102 @@ html.discourse-touch .live-call-widget {
}
}
+.live-room-header {
+ &__title {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ min-width: 0;
+ height: var(--chat-header-offset, 45px);
+ white-space: nowrap;
+ }
+
+ &__name {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ min-width: 0;
+ margin: 0;
+ font-size: var(--font-0);
+ font-weight: 700;
+ }
+
+ &__info-trigger {
+ gap: var(--space-2);
+ min-width: 0;
+ padding: 0;
+ font: inherit;
+ color: var(--primary);
+
+ &:hover,
+ &:focus-visible {
+ background: none;
+ color: var(--primary);
+
+ .discourse-no-touch & {
+ background: none;
+ color: var(--primary);
+ }
+ }
+
+ .d-button-label {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+
+ &__participants {
+ color: var(--primary-medium);
+ font-size: var(--font-down-1);
+ white-space: nowrap;
+ }
+
+ &__icon {
+ position: relative;
+ font-size: var(--font-up-1);
+ color: var(--primary-medium);
+ line-height: 1;
+ }
+
+ &__restricted-icon {
+ position: absolute;
+ top: -20%;
+ right: -30%;
+ width: 40%;
+ height: 40%;
+ padding: 2px 2px 3px;
+ border-radius: 50%;
+ background-color: var(--secondary);
+ color: var(--primary-high);
+ }
+
+ &__fallback {
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ padding: 0 0.67em;
+ border-block-end: 1px solid var(--content-border-color);
+ background: var(--secondary);
+ }
+
+ &__actions {
+ display: flex;
+ align-items: center;
+ height: var(--chat-header-offset, 45px);
+ margin-inline-start: auto;
+ }
+}
+
+body.has-sidebar-page #main-outlet-wrapper:has(.live-room-header) {
+ gap: 0;
+}
+
+#main-outlet:has(.live-room-header) {
+ padding-top: 0;
+}
+
// Split "combo" button (mic/camera) shared by LiveCallControls in both the
// room page and the widget: the main toggle and its caret read as one button.
// The main button drops its trailing border so the caret's leading border is
@@ -649,12 +713,11 @@ html.discourse-touch .live-call-widget {
padding-block-end: 1px;
}
- .live-room-page__sidebar {
+ .live-room-page .chat-side-panel {
position: fixed;
- inset-block: var(--header-offset, 4em) 0;
+ inset-block: var(--main-outlet-offset, 4em) 0;
inset-inline: 0;
z-index: 1050;
- flex: none;
width: auto;
background: var(--secondary);
animation-name: live-drawer-in;
@@ -713,6 +776,10 @@ html.discourse-touch .live-call-widget {
background: #000;
}
+ &:fullscreen &__menu {
+ display: none;
+ }
+
&:fullscreen &__video {
object-fit: contain;
}
@@ -814,13 +881,11 @@ html.discourse-touch .live-call-widget {
@keyframes live-sidebar-in {
from {
- flex-basis: 0;
width: 0;
opacity: 0;
}
to {
- flex-basis: 22rem;
width: 22rem;
opacity: 1;
}
@@ -828,13 +893,11 @@ html.discourse-touch .live-call-widget {
@keyframes live-sidebar-out {
from {
- flex-basis: 22rem;
width: 22rem;
opacity: 1;
}
to {
- flex-basis: 0;
width: 0;
opacity: 0;
}
diff --git a/plugins/live/config/locales/client.en.yml b/plugins/live/config/locales/client.en.yml
index 9d3004a4873..4bc6db22579 100644
--- a/plugins/live/config/locales/client.en.yml
+++ b/plugins/live/config/locales/client.en.yml
@@ -41,7 +41,7 @@ en:
type_stage_hint: "Participants join as listeners. Moderators can promote listeners to speakers."
listeners_cannot_unmute: "Only speakers can unmute in this room."
open_page: "Show full room view"
- widget_mode: "Widget view"
+ widget_mode: "Picture-in-picture"
settings: "Call settings"
more: "More options"
audio_options: "Audio options"
@@ -57,12 +57,15 @@ en:
recording_stopped_toast: "The recording has stopped."
room_page:
empty: "No one is here yet — join to get things started."
+ participant_count:
+ one: "%{count} in room"
+ other: "%{count} in room"
widget:
title: "Active live room: %{room}"
open_chat: "Open room chat"
- expand: "Expand call widget"
- hide: "Hide call widget"
- show: "Show call widget"
+ expand: "Expand picture-in-picture"
+ hide: "Hide picture-in-picture"
+ show: "Show picture-in-picture"
overflow_tile:
one: "Show %{count} more participant"
other: "Show %{count} more participants"
@@ -71,6 +74,7 @@ en:
title: "Chat"
open: "Open chat"
close: "Close chat"
+ unavailable_title: "Zoinks!"
unavailable: "Chat is unavailable right now."
empty_title: "No chat yet"
empty_body: "Send a message to get the conversation started."
diff --git a/plugins/live/spec/system/live_room_chat_panel_spec.rb b/plugins/live/spec/system/live_room_chat_panel_spec.rb
index 5ec73b33ab1..651026d566b 100644
--- a/plugins/live/spec/system/live_room_chat_panel_spec.rb
+++ b/plugins/live/spec/system/live_room_chat_panel_spec.rb
@@ -33,7 +33,7 @@ describe "Live room chat panel" do
visit("/live/r/#{room.slug}?chat=true")
click_button(I18n.t("js.live.room.join"))
# The panel slides in; typing into it mid-animation can miss the composer.
- wait_for_animation(find(".live-room-page__sidebar"))
+ wait_for_animation(find(".chat-side-panel"))
# The real chat thread component, not a re-implementation.
expect(page).to have_css(".live-chat .chat-thread")
@@ -68,7 +68,7 @@ describe "Live room chat panel" do
visit("/live/r/#{stage_room.slug}")
click_button(I18n.t("js.live.room.join"))
- expect(page).to have_css(".live-room-page__sidebar .live-chat")
+ expect(page).to have_css(".chat-side-panel .live-chat")
expect(page).to have_current_path("/live/r/#{stage_room.slug}")
end
@@ -77,23 +77,25 @@ describe "Live room chat panel" do
click_button(I18n.t("js.live.room.join"))
expect(page).to have_css(".live-room-page__leave")
- expect(page).to have_no_css(".live-room-page__sidebar")
+ expect(page).to have_no_css(".chat-side-panel")
end
it "opens the session thread from the first message sent through the starter composer" do
visit("/live/r/#{room.slug}?chat=true")
click_button(I18n.t("js.live.room.join"))
# The panel slides in; typing into it mid-animation can miss the composer.
- wait_for_animation(find(".live-room-page__sidebar"))
+ wait_for_animation(find(".chat-side-panel"))
# No thread yet: the panel offers the starter composer, not the thread UI.
- expect(page).to have_css(".live-chat__input")
+ expect(page).to have_css(".chat-composer__wrapper.--live .chat-composer__input")
expect(page).to have_no_css(".live-chat .chat-thread")
- find(".live-chat__input").fill_in(with: "kicking things off")
+ find(".chat-composer__wrapper.--live .chat-composer__input").fill_in(with: "kicking things off")
# See the note above: the first send races thread creation, its message
# fetch, and the native composer's mount/focus against the settle check.
- using_wait_time(20) { find(".live-chat__input").send_keys(:enter) }
+ using_wait_time(20) do
+ find(".chat-composer__wrapper.--live .chat-composer__input").send_keys(:enter)
+ end
# The first message creates the thread and the panel swaps to the native UI.
expect(page).to have_css(".live-chat .chat-thread")
diff --git a/plugins/live/spec/system/live_rooms_spec.rb b/plugins/live/spec/system/live_rooms_spec.rb
index 563515743fa..ac55bc7ba37 100644
--- a/plugins/live/spec/system/live_rooms_spec.rb
+++ b/plugins/live/spec/system/live_rooms_spec.rb
@@ -14,7 +14,9 @@ describe "Live rooms" do
end
def click_call_widget_open_page_button
- within(".live-call-widget__controls") { find(".d-icon-expand").ancestor("button").click }
+ within(".live-call-widget__controls") do
+ find(".d-icon-discourse-expand").ancestor("button").click
+ end
end
def click_call_widget_leave_button
diff --git a/plugins/live/svg-icons/plugin-icons.svg b/plugins/live/svg-icons/plugin-icons.svg
new file mode 100644
index 00000000000..9a05c54741a
--- /dev/null
+++ b/plugins/live/svg-icons/plugin-icons.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. -->
+<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+ <symbol id="picture-in-picture" viewBox="0 0 512 512"><path d="M448 32c35.3 0 64 28.7 64 64l0 112-64 0 0-112-384 0 0 320 144 0 0 64-144 0-6.5-.3c-30.1-3.1-54.1-27-57.1-57.1L0 416 0 96C0 62.9 25.2 35.6 57.5 32.3L64 32 448 32zm16 224c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48l160 0z"/></symbol>
+</svg>
diff --git a/plugins/live/test/javascripts/unit/lib/fullscreen-test.js b/plugins/live/test/javascripts/unit/lib/fullscreen-test.js
index afc741be307..13974ca662f 100644
--- a/plugins/live/test/javascripts/unit/lib/fullscreen-test.js
+++ b/plugins/live/test/javascripts/unit/lib/fullscreen-test.js
@@ -78,4 +78,63 @@ module("Live | Unit | Lib | fullscreen", function () {
"fullscreening the gallery container does not hijack a single video"
);
});
+
+ module("while an element is fullscreen", function (hooks) {
+ let exitCalls;
+
+ function setFullscreenElement(element) {
+ Object.defineProperty(document, "fullscreenElement", {
+ configurable: true,
+ get: () => element,
+ });
+ }
+
+ hooks.beforeEach(function () {
+ exitCalls = 0;
+ Object.defineProperty(document, "exitFullscreen", {
+ configurable: true,
+ value: () => {
+ exitCalls++;
+ return Promise.resolve();
+ },
+ });
+ });
+
+ hooks.afterEach(function () {
+ delete document.fullscreenElement;
+ delete document.exitFullscreen;
+ });
+
+ test("fullscreens another element on top instead of exiting", function (assert) {
+ let requested = false;
+ const tile = {
+ requestFullscreen() {
+ requested = true;
+ return Promise.resolve();
+ },
+ };
+ setFullscreenElement({});
+
+ toggleTileFullscreen(tile);
+
+ assert.true(requested, "requests fullscreen for the tile");
+ assert.strictEqual(exitCalls, 0, "does not exit the current fullscreen");
+ });
+
+ test("exits when the element itself is fullscreen", function (assert) {
+ let requested = false;
+ const tile = {
+ requestFullscreen() {
+ requested = true;
+ return Promise.resolve();
+ },
+ };
+ setFullscreenElement(tile);
+
+ toggleTileFullscreen(tile);
+
+ assert.strictEqual(exitCalls, 1, "exits fullscreen");
+ assert.false(requested, "does not request fullscreen again");
+ });
+ });
});