Skip to content

Fix required keys validation tooltip position in emergency access settings#439

Merged
mindmonk merged 2 commits intodevelopfrom
feature/required-key-validation-tooltip-position
Apr 16, 2026
Merged

Fix required keys validation tooltip position in emergency access settings#439
mindmonk merged 2 commits intodevelopfrom
feature/required-key-validation-tooltip-position

Conversation

@mindmonk
Copy link
Copy Markdown
Contributor

@mindmonk mindmonk commented Apr 7, 2026

  • Validation tooltip for the "Required Keys" input in AdminSettingsEmergencyAccess was rendered below the input instead of above it
  • Restructured tooltip markup to match the existing pattern used by the keyholders field (MultiUserSelectInputGroup): -translate-y-full to position above, arrow inside the tooltip box pointing downward

Before:
Bildschirmfoto 2026-04-07 um 08 57 21

After:
Bildschirmfoto 2026-04-07 um 09 31 55

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f6364219-fc31-499d-b7f5-5f86377243eb

📥 Commits

Reviewing files that changed from the base of the PR and between 77b1dc2 and 3b3555d.

📒 Files selected for processing (1)
  • frontend/src/components/AdminSettingsEmergencyAccess.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/AdminSettingsEmergencyAccess.vue

Walkthrough

Refactored the tooltip/help layout for the requiredKeyShares field in frontend/src/components/AdminSettingsEmergencyAccess.vue. Removed an extra wrapper and the previous input-adjacent relative container; the tooltip now renders inside a relative flex-1 container and uses centered absolute positioning (left-1/2, -translate-x-1/2, -top-2, -translate-y-full). The arrow markup was consolidated into a single centered element inside the tooltip content. Conditional rendering logic for tooltip visibility was unchanged. Changes: +19 / -20 lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • SailReal
  • overheadhunter
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the tooltip position for the required keys validation in the emergency access settings component.
Description check ✅ Passed The description is directly related to the changeset, explaining the tooltip positioning issue and the restructuring approach with before/after screenshots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/required-key-validation-tooltip-position

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/components/AdminSettingsEmergencyAccess.vue (1)

55-72: Improve error tooltip accessibility linkage to the input.

Please link the tooltip and input for screen readers (aria-invalid, aria-describedby, role="alert"), and make the tooltip box relative so the arrow is anchored to it predictably.

Suggested patch
             <div
               v-if="defaultRequiredEmergencyKeySharesLessThenTwoError || defaultRequiredEmergencyKeySharesToHighError instanceof FormValidationFailedError"
+              id="requiredKeySharesError"
+              role="alert"
+              aria-live="polite"
               class="absolute left-1/2 -translate-x-1/2 -top-2 transform -translate-y-full z-10"
             >
-              <div class="bg-red-50 border border-red-300 text-red-900 px-2 py-1 rounded shadow-sm text-sm hyphens-auto">
+              <div class="relative bg-red-50 border border-red-300 text-red-900 px-2 py-1 rounded shadow-sm text-sm hyphens-auto">
                 {{ requiredKeySharesValidationText }}
                 <!-- Arrow -->
                 <div class="absolute bottom-0 left-1/2 transform translate-y-1/2 rotate-45 w-2 h-2 bg-red-50 border-r border-b border-red-300"></div>
               </div>
             </div>
             <input
               id="requiredKeyShares"
               v-model.number="requiredShares"
               type="number" min="2" max="255"
               :disabled="!enableEmergencyAccess"
               class="rounded-md border-gray-300 shadow-sm sm:text-sm focus:ring-primary focus:border-primary text-left w-full disabled:cursor-not-allowed disabled:bg-gray-200"
               :class="{ 'border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500': defaultRequiredEmergencyKeySharesError || defaultRequiredEmergencyKeySharesToHighError instanceof FormValidationFailedError}"
+              :aria-invalid="!!(defaultRequiredEmergencyKeySharesLessThenTwoError || defaultRequiredEmergencyKeySharesToHighError)"
+              :aria-describedby="(defaultRequiredEmergencyKeySharesLessThenTwoError || defaultRequiredEmergencyKeySharesToHighError) ? 'requiredKeySharesError' : undefined"
               :aria-label="t('admin.emergencyAccess.requiredKeys.ariaLabel')"
             />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/AdminSettingsEmergencyAccess.vue` around lines 55 -
72, Make the validation tooltip accessible by giving the tooltip a stable id and
a relative container, adding role="alert" to it, and linking it to the input via
aria-describedby and aria-invalid when any validation error is present: update
the tooltip div (the element shown when
defaultRequiredEmergencyKeySharesLessThenTwoError ||
defaultRequiredEmergencyKeySharesToHighError instanceof
FormValidationFailedError) to include a unique id (e.g.,
requiredKeySharesErrorId), add the CSS positioning class relative to the tooltip
container so the arrow anchors predictably, and add role="alert"; then update
the input with id="requiredKeyShares" to set :aria-describedby="error ?
'requiredKeySharesErrorId' : null" and :aria-invalid="error" (where error is the
existing expression checking defaultRequiredEmergencyKeyShares... and
defaultRequiredEmergencyKeySharesToHighError instanceof
FormValidationFailedError or defaultRequiredEmergencyKeySharesError), keeping
the existing v-model.number="requiredShares" and class bindings unchanged and
referencing the same boolean expressions (or a new computed like
hasRequiredKeySharesError) to ensure screen readers are informed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/components/AdminSettingsEmergencyAccess.vue`:
- Around line 55-72: Make the validation tooltip accessible by giving the
tooltip a stable id and a relative container, adding role="alert" to it, and
linking it to the input via aria-describedby and aria-invalid when any
validation error is present: update the tooltip div (the element shown when
defaultRequiredEmergencyKeySharesLessThenTwoError ||
defaultRequiredEmergencyKeySharesToHighError instanceof
FormValidationFailedError) to include a unique id (e.g.,
requiredKeySharesErrorId), add the CSS positioning class relative to the tooltip
container so the arrow anchors predictably, and add role="alert"; then update
the input with id="requiredKeyShares" to set :aria-describedby="error ?
'requiredKeySharesErrorId' : null" and :aria-invalid="error" (where error is the
existing expression checking defaultRequiredEmergencyKeyShares... and
defaultRequiredEmergencyKeySharesToHighError instanceof
FormValidationFailedError or defaultRequiredEmergencyKeySharesError), keeping
the existing v-model.number="requiredShares" and class bindings unchanged and
referencing the same boolean expressions (or a new computed like
hasRequiredKeySharesError) to ensure screen readers are informed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cdaa2913-a848-458f-89c4-06dc9ebff44e

📥 Commits

Reviewing files that changed from the base of the PR and between 23fe979 and 77b1dc2.

📒 Files selected for processing (1)
  • frontend/src/components/AdminSettingsEmergencyAccess.vue

@mindmonk mindmonk requested a review from overheadhunter April 7, 2026 07:37
@mindmonk mindmonk merged commit 154cfae into develop Apr 16, 2026
10 checks passed
@mindmonk mindmonk deleted the feature/required-key-validation-tooltip-position branch April 16, 2026 08:06
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.

2 participants