-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(keyboard-shortcut): enhance keyboard-shortcut button UI and background #575
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -105,7 +105,7 @@ export function KeyboardShortcutsHelp() { | |||||||||||||||||
| return ( | ||||||||||||||||||
| <Dialog open={open} onOpenChange={setOpen}> | ||||||||||||||||||
| <DialogTrigger asChild> | ||||||||||||||||||
| <Button variant="text" size="sm" className="gap-2"> | ||||||||||||||||||
| <Button variant="text" size="sm" className="gap-2 dark:bg-neutral-800 dark:border-neutral-800 dark:text-white bg-gray-200 border-1 border-gray-300 text-black "> | ||||||||||||||||||
| <Keyboard className="w-4 h-4" /> | ||||||||||||||||||
| Shortcuts | ||||||||||||||||||
| </Button> | ||||||||||||||||||
|
Comment on lines
+108
to
111
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. 💡 Verification agent 🧩 Analysis chainUse design tokens/variants instead of hardcoded colors; replace non-standard border-1. Prefer our system tokens and existing variants for cross-theme consistency. - <Button variant="text" size="sm" className="gap-2 dark:bg-neutral-800 dark:border-neutral-800 dark:text-white bg-gray-200 border-1 border-gray-300 text-black ">
+ <Button variant="secondary" size="sm">
<Keyboard className="w-4 h-4" />
Shortcuts
</Button>To verify 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for 'border-1' usages..."
rg -n -S '\bborder-1\b' -C2
echo -e "\nChecking Tailwind config(s) for custom border widths..."
fd -a 'tailwind*.{js,ts,cjs,mjs}' | while read -r f; do
echo "==> $f"
rg -n 'borderWidth|extend' "$f" -C3 || true
done
echo -e "\nScanning for matchUtilities/addUtilities defining custom border classes..."
rg -n 'matchUtilities|addUtilities' --type js --type ts --type tsx --type jsx -C2Length of output: 1223 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for 'border-1' usages..."
rg -n -S '\bborder-1\b' -C2 .
echo -e "\nLocating Tailwind config files..."
find . -type f -name "tailwind.config.*" -print
echo -e "\nChecking Tailwind config(s) for custom borderWidth extends..."
find . -type f -name "tailwind.config.*" -print | while read -r f; do
echo "==> $f"
grep -nE 'borderWidth|extend' "$f" || true
done
echo -e "\nScanning for custom border utilities with matchUtilities or addUtilities..."
rg -nE 'matchUtilities\(|addUtilities\(' --type js --type ts --type tsx --type jsx -C2 .Length of output: 1357 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Import statement for Button in keyboard-shortcuts-help.tsx:"
grep -n "import.*Button" apps/web/src/components/keyboard-shortcuts-help.tsx || true
echo -e "\nListing files in ui component directory:"
ls apps/web/src/components/ui || true
echo -e "\nDisplaying the beginning of the Button component implementation:"
for f in apps/web/src/components/ui/button.*; do
if [[ -f "$f" ]]; then
echo "==> $f"
sed -n '1,100p' "$f"
fi
doneLength of output: 3900 Replace hardcoded color classes and invalid Use the built-in apps/web/src/components/keyboard-shortcuts-help.tsx - <Button variant="text" size="sm" className="gap-2 dark:bg-neutral-800 dark:border-neutral-800 dark:text-white bg-gray-200 border-1 border-gray-300 text-black ">
+ <Button variant="secondary" size="sm">
<Keyboard className="w-4 h-4" />
Shortcuts
</Button>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
@@ -178,14 +178,14 @@ function ShortcutItem({ | |||||||||||||||||
| }); | ||||||||||||||||||
|
|
||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className="flex items-center justify-between"> | ||||||||||||||||||
| <div className="flex items-center py-0.5 justify-between"> | ||||||||||||||||||
| <div className="flex items-center gap-3"> | ||||||||||||||||||
| {shortcut.icon && ( | ||||||||||||||||||
| <div className="text-muted-foreground">{shortcut.icon}</div> | ||||||||||||||||||
| )} | ||||||||||||||||||
| <span className="text-sm">{shortcut.description}</span> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div className="flex items-center gap-1"> | ||||||||||||||||||
| <div className="flex items-center gap-1"> | ||||||||||||||||||
| {displayKeys.map((key: string, index: number) => ( | ||||||||||||||||||
| <div key={key} className="flex items-center gap-1"> | ||||||||||||||||||
| <div className="flex items-center"> | ||||||||||||||||||
|
|
@@ -232,7 +232,7 @@ function EditableShortcutKey({ | |||||||||||||||||
| variant="outline" | ||||||||||||||||||
| size="sm" | ||||||||||||||||||
| className={`font-sans px-2 min-w-6 min-h-6 leading-none mr-1 hover:bg-opacity-80 ${ | ||||||||||||||||||
| isRecording ? "border-primary bg-primary/10" : "border bg-accent/50" | ||||||||||||||||||
| isRecording ? "border-primary bg-primary/10" : "border bg-foreground/15" | ||||||||||||||||||
| }`} | ||||||||||||||||||
| onClick={handleClick} | ||||||||||||||||||
| title={ | ||||||||||||||||||
|
|
||||||||||||||||||
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.
The
border-1class is invalid in Tailwind CSS. Useborderinstead for a 1px border.View Details
Analysis
The newly added styling includes
border-1which is not a valid Tailwind CSS class. Standard Tailwind CSS usesborderfor a 1px border,border-2for 2px,border-4for 4px, etc. Theborder-1class doesn't exist and will not apply any styling.Looking at the existing codebase, all border usage follows the standard Tailwind pattern with
borderfor 1px borders (e.g.,border border-destructive/20,border border-foreground/15) andborder-2for 2px borders where needed.The fix is simple: change
border-1 border-gray-300toborder border-gray-300.