Indicate form field readonly via background#37175
Conversation
The 'Run As Username' field on the install page was a readonly input that looked editable but wasn't, confusing users on mobile devices where the on-screen keyboard wouldn't appear. Style readonly inputs in inline form fields to look like plain text by removing border, background, and horizontal padding. Also update the help text to clarify the value is auto-detected. Fixes go-gitea#37174 Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
What's the UI/UX best practice of using "readonly"? How do other frameworks or web sites do? My understanding is:
|
|
And, since it is "readonly", the required red star |
|
I think If used, it must be manually indicated, which was done here, so we could also just remove the styling and keep the help text-only change if you don't like the styling. @lunny why not backport? Stale translation issue? Given that it's a pure improvement, I see no reason not to backport only for the styling change. |
|
A subtle background color change seems the most common way frameworks indicate it and I agree. |
Replace the previous transparent/plain-text approach for readonly inputs with a subtle background color using --color-secondary-bg. Use proper Fomantic override selectors without !important for input, textarea, select, and dropdown elements. Remove misleading required asterisk from the readonly run_user field on the install page since the value is auto-detected and not editable. Add devtest page at /devtest/form-fields showcasing all form field types (input, textarea, select, dropdown) in their various states (normal, readonly, disabled, error, required). Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
It seems that "error" doesn't have border radius (it's not a blocker, just a nit) |
|
Yes I noticed too, may as well fix it here. |
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: silverwind <me@silverwind.io>
It's backport 1.25 |
The `Run As Username` field on the install page was a `readonly` input that looked editable but wasn't, confusing users. Style `readonly` inputs with a subtle background, matching other frameworks. Fixes: go-gitea#37174 Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
…, #37180) (#37184) Backport #37175 by @silverwind The `Run As Username` field on the install page was a `readonly` input that looked editable but wasn't, confusing users. Style `readonly` inputs with a subtle background, matching other frameworks. <img width="735" height="131" alt="image" src="https://github.com/user-attachments/assets/cb76ce71-faab-4300-811e-e4c503b59f9a" /> Backport #37180 The comment "so just use current one if config says default" is not right anymore: "git" isn't the "default" value of RunUser (Comment out app.example.ini #15807). The RunUser's value is from current session's username. Fixes #37174 --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* main: Add comment for the design of "user activity time" (go-gitea#37195) fix(api): handle missing base branch in PR commits API (go-gitea#37193) Refactor htmx and fetch-action related code (go-gitea#37186) Fix encoding for Matrix Webhooks (go-gitea#37190) Always show owner/repo name in compare page dropdowns (go-gitea#37172) fix(api): handle fork-only commits in compare API (go-gitea#37185) Improve Contributing docs and set a release schedule (go-gitea#37109) Update Nix flake (go-gitea#37183) Remove outdated RunUser logic (go-gitea#37180) Refactor flash message and remove SanitizeHTML template func (go-gitea#37179) Indicate form field readonly via background (go-gitea#37175) Remove dead CSS rules (go-gitea#37173) Fix flaky `TestCatFileBatch/QueryTerminated` test (go-gitea#37159) Implement logout redirection for reverse proxy auth setups (go-gitea#36085) Add missing `//nolint:depguard` (go-gitea#37162)


The
Run As Usernamefield on the install page was areadonlyinput that looked editable but wasn't, confusing users. Stylereadonlyinputs with a subtle background, matching other frameworks.Fixes #37174
This PR was written with the help of Claude Opus 4.6