Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/renderer/components/WatchVideoLiveChat/WatchVideoLiveChat.css
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the nesting, as it doesn't play well with Vue's scoped styles causing styles to "leak" into other components. In all the plain CSS files we've done it properly without nesting, the only reason that some SCSS files have nesting is because it is technical debt that we haven't cleaned up yet.

TODO for myself: Check if there is a stylelint rule we can use to enforce no-nesting with the linters.

Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,38 @@
position: relative;
inset-block-start: 0.45rem;
}

.popoutChatButton {
border-radius: 50%;
border-style: none;
background-color: transparent;
line-height: 1em;
color: var(--primary-text-color);
cursor: pointer;
font-size: 20px;
transition: background 0.2s ease-out;
}

.popoutChatButton:hover {
background-color: var(--side-nav-hover-color);
color: var(--side-nav-hover-text-color);
transition: background 0.2s ease-in;
}

.popoutChatButton:active {
background-color: var(--tertiary-text-color);
color: var(--side-nav-active-text-color);
transition: background 0.2s ease-in;
}

.titleContainer {
display: flex;
justify-content: space-between;
margin-block: 1em;

.title,
.popoutChatButton {
padding: 10px;
}
}

34 changes: 28 additions & 6 deletions src/renderer/components/WatchVideoLiveChat/WatchVideoLiveChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,31 @@
v-else
class="relative"
>
<h4>
{{ t("Video.Live Chat") }}
<div
class="titleContainer"
>
<span
v-if="!hideVideoViews && watchingCount !== null"
class="watchingCount"
class="title"
>
{{ t('Global.Counts.Watching Count', { count: formattedWatchingCount }, watchingCount) }}
{{ t("Video.Live Chat") }}
<span
v-if="!hideVideoViews && watchingCount !== null"
class="watchingCount"
>
{{ t('Global.Counts.Watching Count', { count: formattedWatchingCount }, watchingCount) }}
</span>
</span>
</h4>
<button
class="popoutChatButton"
:title="$t('Video.Popout Live Chat')"
@click="popoutChat"
>
<FontAwesomeIcon
class="popoutChatIcon"
:icon="['fas', 'fa-arrow-up-right-from-square']"
/>
</button>
Comment on lines +59 to +68
Copy link
Member

Choose a reason for hiding this comment

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

Please use a link instead of a button, as it is a link and using a button bypasses the external link handling setting.

Choose a reason for hiding this comment

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

Nesting seems to be resolved but this isnt yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been too busy to address this, but hopefully in a week or so can get to it. Just to confirm, it should be a regular <a> html link?

Choose a reason for hiding this comment

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

I've been too busy to address this, but hopefully in a week or so can get to it. Just to confirm, it should be a regular <a> html link?

@absidue

</div>
<div
v-if="superChatComments.length > 0"
class="superChatComments"
Expand Down Expand Up @@ -571,6 +587,12 @@ function scrollToBottom() {
stayAtBottom = true
showScrollToBottom.value = false
}

function popoutChat() {
const url = `https://www.youtube.com/live_chat?is_popout=1&v=${props.videoId}`
window.open(url, '_blank', 'noreferrer')
}

</script>

<style scoped src="./WatchVideoLiveChat.css" />
2 changes: 2 additions & 0 deletions src/renderer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
faArrowLeft,
faArrowRight,
faArrowUp,
faArrowUpRightFromSquare,
faBars,
faBarsProgress,
faBorderAll,
Expand Down Expand Up @@ -146,6 +147,7 @@ library.add(
faArrowLeft,
faArrowRight,
faArrowUp,
faArrowUpRightFromSquare,
faBars,
faBarsProgress,
faBorderAll,
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ Video:
Live Now: Live Now
Live Chat: Live Chat
Enable Live Chat: Enable Live Chat
Popout Live Chat: Popout Chat
Live Chat is currently not supported in this build.: Live Chat is currently not
supported in this build.
Live chat is enabled. Chat messages will appear here once sent.: Live chat is enabled. Chat
Expand Down