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

fix(TopBar): migrate to NcPopover #13332

Merged
merged 2 commits into from
Sep 19, 2024
Merged
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
40 changes: 26 additions & 14 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@
:class="{'description__in-chat' : !isInCall }">
{{ statusMessage }}
</p>
<template v-if="conversation.description">
<p v-tooltip.bottom="{
content: renderedDescription,
delay: { show: 500, hide: 500 },
autoHide: false,
html: true,
}"
class="description"
:class="{'description__in-chat' : !isInCall }">
{{ conversation.description }}
</p>
</template>
<NcPopover v-if="conversation.description"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed, that popover might be wider than a description:
image

:focus-trap="false"
:delay="500"
DorraJaouad marked this conversation as resolved.
Show resolved Hide resolved
:boundary="boundaryElement"
:popper-triggers="['hover']"
:triggers="['hover']">
<template #trigger="{ attrs }">
<p v-bind="attrs"
Comment on lines +42 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

<p> cannot have aria- attributes from attr, it is not valid.

But it is also not valid to make <p> an interactive trigger...

Copy link
Contributor

Choose a reason for hiding this comment

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

it's already inside of <a>, which triggers settings dialog to open, and <p> only listening to mouseover
So, not much we can do?

class="description"
:class="{'description__in-chat' : !isInCall }">
{{ conversation.description }}
</p>
</template>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="description__popover" v-html="renderedDescription" />
DorraJaouad marked this conversation as resolved.
Show resolved Hide resolved
</NcPopover>
</div>
</a>

Expand Down Expand Up @@ -123,6 +127,7 @@ import { t, n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcPopover from '@nextcloud/vue/dist/Components/NcPopover.js'
import { useIsMobile } from '@nextcloud/vue/dist/Composables/useIsMobile.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
import richEditor from '@nextcloud/vue/dist/Mixins/richEditor.js'
Expand All @@ -138,7 +143,6 @@ import ConversationIcon from '../ConversationIcon.vue'

import { useGetParticipants } from '../../composables/useGetParticipants.js'
import { AVATAR, CONVERSATION } from '../../constants.js'
import BrowserStorage from '../../services/BrowserStorage.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { useChatExtrasStore } from '../../stores/chatExtras.js'
import { useSidebarStore } from '../../stores/sidebar.js'
Expand All @@ -160,6 +164,7 @@ export default {
ConversationIcon,
TopBarMediaControls,
NcButton,
NcPopover,
TopBarMenu,
TasksCounter,
ReactionMenu,
Expand Down Expand Up @@ -202,6 +207,7 @@ export default {
data: () => {
return {
showBreakoutRoomsEditor: false,
boundaryElement: document.querySelector('.main-view'),
}
},

Expand Down Expand Up @@ -424,7 +430,7 @@ export default {
}
}
.title {
font-weight: bold;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
}
Expand All @@ -438,6 +444,12 @@ export default {
}
}

.description__popover {
padding: var(--default-grid-baseline);
DorraJaouad marked this conversation as resolved.
Show resolved Hide resolved
width: fit-content;
max-width: 50em;
}

.icon {
display: flex;
}
Expand Down
Loading