feat(ui): render workspace-context notifications with styled chips

The login-success and tenant-switch toasts previously showed the
workspace name and role inline as bracketed plain text, which read
flat and made the two key data points hard to scan at a glance.

Render them through a shared `renderWorkspaceNotifyContent` helper
that produces a NotifyPlugin VNode with:

* a neutral rounded chip for the workspace name (with a generic
  workspace icon), and
* a role-coloured chip for the role (with the existing per-role icon
  from useRoleLabel), so owner / admin / contributor / viewer each
  get a distinct visual identity that matches the role badges used
  elsewhere in the product.

The i18n templates lose the surrounding 「」 / "" / «» quote marks
because the chip itself now provides the visual delineation; double
emphasis looked off. Translators control the surrounding wording via
`{name}` and `{role}` placeholders and the renderer splits on those
markers to interleave plain text and chips in the original order.

The PendingTenantSwitchToast payload (sessionStorage-stashed for the
hard-reload survival trick) grows a `roleEnum` field so the post-
reload toast can colour the chip — without that, the switch toast
would fall back to a neutral chip while the login toast got the
colour treatment.

Note on icon resolution: the chip renderer imports TDesign's `Icon`
component directly rather than referencing it by string tag in `h()`
— Vue's render function does not auto-resolve component names the
way templates do, so `h('t-icon', ...)` would silently render an
unknown HTML element.
This commit is contained in:
wizardchen
2026-05-18 20:32:50 +08:00
committed by lyingbug
parent 60a579d869
commit 559b5a6e20
11 changed files with 224 additions and 31 deletions
+4 -4
View File
@@ -1148,8 +1148,8 @@ export default {
forgotPassword: "비밀번호를 잊으셨나요?",
loginSuccess: "로그인 성공!",
loginSuccessTitle: "로그인 성공",
loginSuccessContent: "환영합니다. 「{name}」에 입장했습니다",
loginSuccessContentWithRole: "환영합니다. 「{name}」에 입장했습니다 · 역할: {role}",
loginSuccessContent: "환영합니다. {name} 에 입장했습니다",
loginSuccessContentWithRole: "환영합니다. {name} 에 입장했습니다 · 역할 {role}",
loginFailed: "로그인 실패",
loggingIn: "로그인 중...",
oidcLogin: "OIDC로 로그인",
@@ -1641,8 +1641,8 @@ export default {
searchHint: "이름으로 검색하거나 테넌트 ID를 직접 입력할 수 있습니다",
noMatch: "일치하는 테넌트를 찾을 수 없습니다",
switchSuccessTitle: "공간이 전환되었습니다",
switchSuccessContent: "「{name}」에 입장했습니다",
switchSuccessContentWithRole: "「{name}」에 입장했습니다 · 역할: {role}",
switchSuccessContent: "{name} 에 입장했습니다",
switchSuccessContentWithRole: "{name} 에 입장했습니다 · 역할 {role}",
loadTenantsFailed: "테넌트 목록 로드 실패",
loading: "로딩 중...",
loadMore: "더 보기",