Repository navigation
Conversation
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.
Agent
This code is AI-assisted. Prepared with Codex CLI 0.163.0, GPT-6 (the host does not expose the exact model identifier), in the Mirasim CLI environment on 2026-11-15 UTC. Git identity was checked against recent core developers; no Git identity configuration was changed.
Links
Closes #2010.
User request
Verbatim:
Later requirements and correction:
Out of scope — refuse
Matched: no. This is an account presentation feature.
Open gate — do not open unless all are satisfied
In scope; new feature linked to #2010; researched against docs and code; verification records commands and observed behavior. Open: yes.
Kind
Issue facts
The current UI lacks an optional user-ID display/copy control in the avatar menu and profile. The user requests quick access to a hash-prefixed account number. Incident frequency is not applicable to this feature. Frontend locations are
/profile, the shared avatar dropdown, and/admin/settings?tab=features; relay, billing, and deployment incident details do not apply.Change
Add the disabled-by-default
show_user_idswitch under Features. Site settings own persistence and expose the switch through administrator reads, the public API, and HTML injection. A shared control displays and copies#IDinside the avatar dropdown and beside the profile name. Closing the dropdown removes its ID control from the header.Research
Duplicate / prior art
Searched issues and PRs for
user ID,用户 ID,显示用户,user identifier, andshow_user_id. Existing matches concern API keys, balance dialogs, and other features. No equivalent display switch was found.Docs and code
docs/guides/index.mdlists operational guides;docs/index.mdroutes configuration and UI rules; the README describes account features.docs/interfaces/configuration.mddefines combined runtime settings and now documents this switch. The implementation follows site settings ownership, the existing feature form, anduseClipboard.tsfeedback.Alternatives considered
The shared control keeps both locations consistent when public settings or the account change.
Files
backend/internal/site/backend/internal/settings/backend/internal/app/settings_composite_runtime_test.gofrontend/src/components/user/UserIdBadge.vueand related components/testsfrontend/src/views/admin/settings/, API types, and locale filesdocs/interfaces/configuration.mdassets/screenshots/user-id-display.pngBehavior
Before: neither requested location offers a configurable ID copy action.
After: enabling the switch displays values such as
#1233in the avatar dropdown and profile. Clicking copies the complete displayed text. Missing/false settings hide both controls; updates omitting the field retain its stored value.Non-goals: changing ID allocation or account permissions.
Verification
go test ./internal/site/... ./internal/settings/... ./internal/app -count=1: all selected packages passed. Regression cases verified disabled defaults, enabled/disabled persistence, omitted-field retention, static ownership, and matching public API/HTML injection values.pnpm --dir frontend exec vitest run --maxWorkers=1 src/components/user/__tests__/UserIdBadge.spec.ts src/components/layout/__tests__/AppHeader.spec.ts src/components/user/profile/__tests__/ProfileInfoCard.spec.ts: 23 tests passed, including copying from the avatar dropdown and hiding its ID while closed.pnpm --dir frontend run lint:check: formatting, ESLint, comments, imports, and UI token checks passed.pnpm --dir frontend run typecheck: no type errors.pnpm --dir frontend run build:assets: production assets built successfully.make fmtandmake fmt-check: repository formatters completed and checks passed.#1233to the browser clipboard; disabling hid both; a 390px viewport had no horizontal overflow. The feature form switch started disabled and responded to a click. Desktop and mobile light/dark layouts were inspected.taskset -c 0,1,nice -n 10, and Go parallelism limited to two.Risks
The switch controls presentation; the current user's authenticated profile supplies the ID. Missing settings keep the feature disabled. Clipboard failures use the existing localized feedback. No follow-up work is identified.
Scope check
Single focused change: yes. Secrets included: no. Unsupported behavior, unchanged upstream errors, and third-party service issues: no.