-
Notifications
You must be signed in to change notification settings - Fork 18
fix: API key key display truncation #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -261,40 +261,42 @@ async function copyKeyTemplate(key: ApiKeyFragment) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| role | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }}</Badge> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex items-center gap-2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="text-sm font-medium text-green-700"><b>API Key:</b></span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="relative max-w-[300px] flex-1"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| :model-value="showKey[key.id] ? key.key : '••••••••••••••••••••••••••••••••'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="w-full rounded px-2 py-1 pr-10 font-mono text-xs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col gap-2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex items-center gap-2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="text-sm font-medium text-green-700"><b>API Key:</b></span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipProvider> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip :delay-duration="0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipTrigger> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="ghost" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size="icon" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="h-8 w-8" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @click="copyKeyValue(key.key)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ClipboardDocumentIcon class="h-4 w-4" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipTrigger> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p>{{ copied ? 'Copied!' : 'Copy to clipboard...' }}</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipProvider> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+267
to
+283
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, verify the file exists and check the actual code at the specified lines
fd "ApiKeyManager.vue" webRepository: unraid/api Length of output: 97 🏁 Script executed: # Read the file to confirm the code snippet
cat -n web/src/components/ApiKey/ApiKeyManager.vue | sed -n '260,290p'Repository: unraid/api Length of output: 1789 🏁 Script executed: # Search for TooltipTrigger imports and usage in the file
rg -n "TooltipTrigger|import.*Tooltip" web/src/components/ApiKey/ApiKeyManager.vueRepository: unraid/api Length of output: 257 🏁 Script executed: # Search for TooltipTrigger component definition or package info
rg -n "TooltipTrigger" web/src/components --type=vue -A2 | head -50Repository: unraid/api Length of output: 81 🏁 Script executed: # Check if as-child is used elsewhere with TooltipTrigger in the codebase
rg "TooltipTrigger.*as-child" web --type=vueRepository: unraid/api Length of output: 81 🏁 Script executed: # Read around line 332 to see the context where as-child IS used
cat -n web/src/components/ApiKey/ApiKeyManager.vue | sed -n '325,345p'Repository: unraid/api Length of output: 1204 🏁 Script executed: # Search for TooltipTrigger patterns without type flag
rg -n "TooltipTrigger" web/src/components/ApiKey/ApiKeyManager.vue -C2Repository: unraid/api Length of output: 1278 🏁 Script executed: # Check for TooltipTrigger usage across the entire codebase
rg "TooltipTrigger(?!.*as-child)" web/src --multiline-dotall 2>/dev/null | head -40Repository: unraid/api Length of output: 36 🏁 Script executed: # Find where TooltipTrigger component is defined or imported from
rg "from.*TooltipTrigger|import.*TooltipTrigger" web/srcRepository: unraid/api Length of output: 190 🏁 Script executed: # Find `@unraid/ui` location - is it in the repo or external?
fd -t f "@unraid/ui" . 2>/dev/null || find . -name "*unraid*" -type d 2>/dev/null | grep -v node_modules | head -20Repository: unraid/api Length of output: 36 🏁 Script executed: # Search for all TooltipTrigger usages in the codebase
rg "TooltipTrigger" web/src --no-heading | sort | uniq -cRepository: unraid/api Length of output: 1567 🏁 Script executed: # Get all TooltipTrigger context across the codebase
rg -B1 -A4 "TooltipTrigger" web/src 2>/dev/nullRepository: unraid/api Length of output: 8458 🏁 Script executed: # Check package.json for `@unraid/ui` info
fd "package.json" web -exec cat {} \; | grep -A5 -B5 "@unraid/ui" | head -20Repository: unraid/api Length of output: 200 Add Line 269 wraps a 🛠️ Suggested fix- <TooltipTrigger>
+ <TooltipTrigger as-child>
<Button
variant="ghost"
size="icon"
class="h-8 w-8"
`@click`="copyKeyValue(key.key)"
>
<ClipboardDocumentIcon class="h-4 w-4" />
</Button>
- </TooltipTrigger>
+ </TooltipTrigger>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="relative min-w-0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="bg-background block w-full rounded border px-3 py-2 pr-10 font-mono text-xs leading-5 break-all whitespace-pre-wrap" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{ showKey[key.id] ? key.key : '••••••••••••••••••••••••••••••••' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </code> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="ghost" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size="icon" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="absolute inset-y-0 right-2 h-auto w-auto px-1 text-gray-500 hover:text-gray-700" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="absolute top-2 right-2 h-auto w-auto px-1 text-gray-500 hover:text-gray-700" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @click="toggleShowKey(key.id)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <component :is="showKey[key.id] ? EyeSlashIcon : EyeIcon" class="h-5 w-5" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipProvider> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip :delay-duration="0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipTrigger> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant="ghost" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size="icon" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class="h-8 w-8" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @click="copyKeyValue(key.key)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ClipboardDocumentIcon class="h-4 w-4" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipTrigger> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TooltipContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p>{{ copied ? 'Copied!' : 'Copy to clipboard...' }}</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </TooltipProvider> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add accessible names to icon-only copy and visibility buttons.
Line 270 and Line 291 use icon-only buttons without accessible names, reducing usability for assistive technologies.
♿ Suggested fix
<Button variant="ghost" size="icon" class="h-8 w-8" + aria-label="Copy API key to clipboard" + title="Copy API key to clipboard" `@click`="copyKeyValue(key.key)" > <ClipboardDocumentIcon class="h-4 w-4" /> </Button> @@ <Button variant="ghost" size="icon" class="absolute top-2 right-2 h-auto w-auto px-1 text-gray-500 hover:text-gray-700" + :aria-label="showKey[key.id] ? 'Hide API key' : 'Show API key'" + :title="showKey[key.id] ? 'Hide API key' : 'Show API key'" `@click`="toggleShowKey(key.id)" >Also applies to: 291-298
🤖 Prompt for AI Agents