Skip to content

fix: [Agent] User information on the debugging page is not clickable - #7757

Merged
shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_debug_chat
Nov 9, 2026
Merged

shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_debug_chat

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: [Agent] User information on the debugging page is not clickable

@shaohuzhang1
shaohuzhang1 merged commit 6e6fbb6 into v3 Nov 9, 2026
3 of 4 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v3@fix_debug_chat branch November 9, 2026 08:11
<div class="mt-3 shrink-0" v-if="SHOW_PROFILE.includes(viewType)">
<AccountMenu />
</div>
</div>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The diff is valid and the intent is clear. No blocking issue from the shown code, but here are review points:

  1. Import formatting

    import { useViewType, VIEW_TYPE ,type ViewType} from '../../view/index'

    Should be formatted as:

    import { useViewType, VIEW_TYPE, type ViewType } from '../../view/index'

    Or use a separate import type { ViewType } ... if your lint rules prefer that.

  2. Verify useViewType() return type
    The existing computed:

    const authProfile = computed(() => (viewType === VIEW_TYPE.CHAT ? auth.authProfile : null))

    compares viewType directly. If useViewType() returns a Ref/ComputedRef, this is likely a bug and should use viewType.value.
    In the template, refs are auto-unwrapped, so:

    v-if="SHOW_PROFILE.includes(viewType)"

    probably works. But for consistency and testability, prefer:

    const showAccountMenu = computed(() =>
      SHOW_PROFILE.includes(viewType.value)
    )

    and:

    v-if="showAccountMenu"

    Adjust .value only if viewType is actually a ref.

  3. Rename SHOW_PROFILE
    It is not a boolean; it is a list of view types controlling the account menu. A clearer name:

    const ACCOUNT_MENU_VIEW_TYPES: readonly ViewType[] = [
      VIEW_TYPE.CHAT,
      VIEW_TYPE.PORTAL,
    ]

    Then:

    v-if="ACCOUNT_MENU_VIEW_TYPES.includes(viewType)"
  4. v-if destroys/remounts AccountMenu
    If AccountMenu has internal state or async initialization, switching view types will destroy and recreate it. Use v-show instead if state preservation is needed, or keep v-if if remounting is acceptable.

  5. Confirm product behavior
    Hiding the account entry in all other view types may remove access to logout/settings. Make sure this is intentional.

  6. Type/export checks
    Ensure ViewType is exported from ../../view/index, and that VIEW_TYPE.PORTAL is actually part of the ViewType union/enum. Otherwise TypeScript will fail.

  7. Minor optimization
    Array.prototype.includes is fine for two values. If the list grows, use a Set<ViewType> and .has(...). The array is also recreated per component instance in <script setup>; negligible here, but it can be moved to module scope if desired.

Suggested small cleanup:

import { useViewType, VIEW_TYPE, type ViewType } from '../../view/index'

const ACCOUNT_MENU_VIEW_TYPES: readonly ViewType[] = [
  VIEW_TYPE.CHAT,
  VIEW_TYPE.PORTAL,
]
<div
  v-if="ACCOUNT_MENU_VIEW_TYPES.includes(viewType)"
  class="mt-3 shrink-0"
>
  <AccountMenu />
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant