Repository navigation
fix(shell): show who is signed in in the avatar menu - #61
Merged
Merged
Conversation
imneov
force-pushed
the
fix/user-menu-content
branch
5 times, most recently
from
October 13, 2026 11:41
c97ad9c to
2d5b2a6
Compare
The menu drew one line, "admin · 管理员", and with server.auth.disabled it drew only that: the change-password and sign-out entries were dropped with no replacement, so the menu read as broken instead of as an install that has no login. The header now carries the avatar, the name, the role and — when console has a User CRD to read it from — the email, and userMenuState() decides the entries instead of an inline !me.authDisabled. Without a login the state also shows in the bar, so it is known before anything is opened, and the bar gains no element: the user button itself turns amber (icon, name, background and a dot on the avatar) and its tooltip carries 登录已关闭,当前为管理员身份 (Sign-in off — acting as the administrator). In that mode the menu draws no entries at all — console can honour neither — and carries the same sentence in their place; signed-in installs keep both entries live. The text names the state rather than the reader: the mode makes every request the administrator, it does not make every account one.
imneov
force-pushed
the
fix/user-menu-content
branch
from
October 13, 2026 15:23
2d5b2a6 to
2797478
Compare
Contributor
Author
|
Merging on LF's instruction (2026-10-13) through the documented flow: issue #60 filed, PR rebased on current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does and why
The avatar menu drew one line,
name · role, and nothing else about the session. Withserver.auth.disabledit drew only that line: the two entries were dropped rather than replaced, so in that mode the menu opened with nothing in it — a dropdown that looks broken next to the one Rise Global's console has.userMenuState(me)inweb/src/shell/user-menu.ts, next touserMenuIdentity(me), so both auth modes are one small tested function instead of an inline!me.authDisabled.server.auth.disabledmakes every request the administrator, it does not make every account one. That mode's decision is unchanged and recorded (docs/console-design.md, "Running without a login": there is no session to end and no stored password to change, and/api/mereturnsauthDisabledfor exactly this).Which issue(s) this PR fixes
Fixes #60
How it was tested
web/:npm run typecheck,npm test(276 passed — the 4 new cases insrc/shell/user-menu.test.tscover both auth modes and the email-only-when-console-has-one rule),vite build.background: warning/10,color: warning,box-shadow: inset 0 0 0 1px warning/45, the avatarwarning/20, a 10px dot with a 2px ring in the bar's own colour,title= the sentence, and the chip's box is unchanged at 90×36 — no element added, no layout shift; the menu then holds the identity and the sentence full-width and zero[data-slot=dropdown-menu-item]nodes;mixed-nav): amber chip, amber text, and the dot's ring matches the dark bar;/api/meproxy reportingauthDisabled: falseand an email): the chip computes a transparent background with no dot, no notice is rendered, and both修改密码and退出登录are present;/api/meproxy reportingauthDisabled: falseand an email): avatar +admin+管理员+ the email +修改密码+退出登录, both enabled and no line.:32609,server.auth.jwtSecretset, the same cluster) to check the real path: the app redirects to/loginand/api/meanswers 401 without a token.Checks
go test ./...andgofmt -l .is emptynpm run typecheck && npm test && npm run buildinweb/(ifweb/changed)helm lint --strict helm/console(if the chart changed)Notes for reviewers
Shell only:
Layout.tsx, two locale files, a newuser-menu.ts+ its test, and a CHANGELOG line. Nothing about the auth-disabled decision changes — the entries are disabled where console cannot honour them, and the menu names the state and shows the identity it does know.Release note