Skip to content

Conversation

@ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Apr 24, 2023

Fix: nextcloud/spreed#9345

Steps to reproduce

  1. Add tabs A, C to NcAppSidebarTabs
  2. Set active B add add tab B

Actual behavior

New tab is added, but not active.

Actual

Expected behavior

New tab is added and active.

Expected

Fix

Local activeTab should be updated on each new tab registration. Previously it was updated only if it wasn't set before (I have no ideas, why).

Manual testing example

It's a bit specific, I decided not to add it to the documentation.

<template>
	<div>
	        <button @click="active = 'settings-tab', showTabs[1] = true">Activate settings and add settings-tab</button>
		<NcCheckboxRadioSwitch :checked.sync="showTabs[0]">Show search tab</NcCheckboxRadioSwitch>
		<NcCheckboxRadioSwitch :checked.sync="showTabs[1]">Show settings tab</NcCheckboxRadioSwitch>
		<NcCheckboxRadioSwitch :checked.sync="showTabs[2]">Show sharing tab</NcCheckboxRadioSwitch>
		<NcAppSidebar
		        :active.sync="active"
			title="cat-picture.jpg"
			subtitle="last edited 3 weeks ago">
			<NcAppSidebarTab v-if="showTabs[0]" name="Search" id="search-tab">
				<template #icon>
					<Magnify :size="20" />
				</template>
				Search tab content
			</NcAppSidebarTab>
			<NcAppSidebarTab v-if="showTabs[1]" name="Settings" id="settings-tab">
				<template #icon>
					<Cog :size="20" />
				</template>
				Settings
			</NcAppSidebarTab>
			<NcAppSidebarTab v-if="showTabs[2]" name="Sharing" id="share-tab">
				<template #icon>
					<ShareVariant :size="20" />
				</template>
				Sharing tab content
			</NcAppSidebarTab>
		</NcAppSidebar>
	</div>
</template>
<script>
import Magnify from 'vue-material-design-icons/Magnify'
import Cog from 'vue-material-design-icons/Cog'
import ShareVariant from 'vue-material-design-icons/ShareVariant'

export default {
	components: {
		Magnify,
		Cog,
		ShareVariant,
	},
	data() {
		return {
		        active: '',
			showTabs: [true, true, false],
		}
	},
}
</script>

@ShGKme ShGKme added bug Something isn't working 3. to review Waiting for reviews feature: app-sidebar Related to the app-sidebar component labels Apr 24, 2023
@ShGKme ShGKme added this to the 7.10.1 milestone Apr 24, 2023
@ShGKme ShGKme self-assigned this Apr 24, 2023
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

Tested with Talk, where we mount "chat" and "participants" tabs when join the call / group conversation

@ShGKme ShGKme merged commit 44c2e9f into master Apr 25, 2023
@ShGKme ShGKme deleted the fix/activating-the-tab-being-added branch April 25, 2023 07:13
@raimund-schluessler raimund-schluessler modified the milestones: 7.10.1, 7.11.0 May 3, 2023
@artonge artonge mentioned this pull request May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working feature: app-sidebar Related to the app-sidebar component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared items tab focused for group chats

6 participants