From dd1fefe84382a350d9e24e12a5ce6db2563d3262 Mon Sep 17 00:00:00 2001
From: Simula_r <18093452+simula-r@users.noreply.github.com>
Date: Wed, 11 Feb 2026 14:26:35 -0800
Subject: [PATCH] =?UTF-8?q?fix:=20credit=20display=20and=20top=20up=20and?=
=?UTF-8?q?=20other=20UI=20display=20if=20personal=20membe=E2=80=A6=20(#87?=
=?UTF-8?q?84)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## Summary
Consolidate scattered role checks for credits, top-up, and subscribe
buttons into centralized workspace permissions (canTopUp,
canManageSubscription), ensuring "Add Credits" requires an active
subscription, subscribe buttons only appear when needed, and team
members see appropriately restricted billing UI.
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8784-fix-credit-display-and-top-up-and-other-UI-display-if-personal-membe-3036d73d3650810fbc2de084f738943c)
by [Unito](https://www.unito.io)
---
.../workspace/InviteMemberDialogContent.vue | 38 +++---
.../topbar/CurrentUserPopoverWorkspace.vue | 125 +++++++++---------
.../SubscriptionPanelContentWorkspace.vue | 38 +++---
.../workspace/composables/useWorkspaceUI.ts | 10 +-
4 files changed, 107 insertions(+), 104 deletions(-)
diff --git a/src/components/dialog/content/workspace/InviteMemberDialogContent.vue b/src/components/dialog/content/workspace/InviteMemberDialogContent.vue
index 479a6b6d1d..bdf614e956 100644
--- a/src/components/dialog/content/workspace/InviteMemberDialogContent.vue
+++ b/src/components/dialog/content/workspace/InviteMemberDialogContent.vue
@@ -70,31 +70,17 @@
@click="onSelectLink"
/>
@@ -118,6 +104,7 @@ import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import Button from '@/components/ui/button/Button.vue'
+import { cn } from '@/utils/tailwindUtil'
import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
import { useDialogStore } from '@/stores/dialogStore'
@@ -130,6 +117,7 @@ const loading = ref(false)
const email = ref('')
const step = ref<'email' | 'link'>('email')
const generatedLink = ref('')
+const justCopied = ref(false)
const isValidEmail = computed(() => {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
@@ -161,6 +149,10 @@ async function onCreateLink() {
async function onCopyLink() {
try {
await navigator.clipboard.writeText(generatedLink.value)
+ justCopied.value = true
+ setTimeout(() => {
+ justCopied.value = false
+ }, 759)
toast.add({
severity: 'success',
summary: t('workspacePanel.inviteMemberDialog.linkCopied'),
diff --git a/src/components/topbar/CurrentUserPopoverWorkspace.vue b/src/components/topbar/CurrentUserPopoverWorkspace.vue
index 64ea81191c..4e10801685 100644
--- a/src/components/topbar/CurrentUserPopoverWorkspace.vue
+++ b/src/components/topbar/CurrentUserPopoverWorkspace.vue
@@ -55,63 +55,61 @@
/>
-
-
-
-
-
- {{
- displayedCredits
- }}
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+ {{
+ displayedCredits
+ }}
+
+
+
+
+
+
+
+
+
| null>(null)
const emit = defineEmits<{
@@ -275,13 +272,15 @@ const canUpgrade = computed(() => {
})
const showPlansAndPricing = computed(
- () => isPersonalWorkspace.value || workspaceRole.value === 'owner'
+ () => permissions.value.canManageSubscription
)
const showManagePlan = computed(
- () => showPlansAndPricing.value && isActiveSubscription.value
+ () => permissions.value.canManageSubscription && isActiveSubscription.value
)
-const showCreditsSection = computed(
- () => isPersonalWorkspace.value || workspaceRole.value === 'owner'
+const showSubscribeAction = computed(
+ () =>
+ permissions.value.canManageSubscription &&
+ (!isActiveSubscription.value || isCancelled.value)
)
const handleOpenUserSettings = () => {
diff --git a/src/platform/cloud/subscription/components/SubscriptionPanelContentWorkspace.vue b/src/platform/cloud/subscription/components/SubscriptionPanelContentWorkspace.vue
index 0ada5c9960..1715b265d3 100644
--- a/src/platform/cloud/subscription/components/SubscriptionPanelContentWorkspace.vue
+++ b/src/platform/cloud/subscription/components/SubscriptionPanelContentWorkspace.vue
@@ -172,16 +172,11 @@
-