-
-
Notifications
You must be signed in to change notification settings - Fork 271
fix(ui): implement clickable package table rows #1277
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
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 |
|---|---|---|
|
|
@@ -44,15 +44,15 @@ const allMaintainersText = computed(() => { | |
|
|
||
| <template> | ||
| <tr | ||
| class="group border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted" | ||
| class="group relative border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted" | ||
| tabindex="0" | ||
| :data-result-index="index" | ||
| > | ||
| <!-- Name (always visible) --> | ||
| <td class="py-2 px-3"> | ||
| <NuxtLink | ||
| :to="packageUrl" | ||
| class="font-mono text-sm text-fg hover:text-accent-fallback transition-colors duration-200" | ||
| class="row-link font-mono text-sm text-fg hover:text-accent-fallback transition-colors duration-200" | ||
| dir="ltr" | ||
| > | ||
| {{ pkg.name }} | ||
|
|
@@ -111,7 +111,7 @@ const allMaintainersText = computed(() => { | |
| name: '~username', | ||
| params: { username: maintainer.username || maintainer.name || '' }, | ||
| }" | ||
| class="hover:text-accent-fallback transition-colors duration-200" | ||
| class="relative z-10 hover:text-accent-fallback transition-colors duration-200" | ||
| @click.stop | ||
| >{{ maintainer.username || maintainer.name || maintainer.email }}</NuxtLink | ||
| ><span v-if="idx < Math.min(pkg.maintainers.length, 3) - 1">, </span> | ||
|
|
@@ -127,7 +127,7 @@ const allMaintainersText = computed(() => { | |
| <td v-if="isColumnVisible('keywords')" class="py-2 px-3 text-end"> | ||
| <div | ||
| v-if="pkg.keywords?.length" | ||
| class="flex flex-wrap gap-1 justify-end" | ||
| class="relative z-10 flex flex-wrap gap-1 justify-end" | ||
| :aria-label="$t('package.card.keywords')" | ||
| > | ||
| <ButtonBase | ||
|
|
@@ -198,3 +198,19 @@ const allMaintainersText = computed(() => { | |
| </td> | ||
| </tr> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .row-link { | ||
| &::after { | ||
| content: ''; | ||
| position: absolute; | ||
| inset: 0; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| &:focus-visible::after { | ||
| outline: 2px solid var(--color-fg); | ||
| outline-offset: -2px; | ||
| } | ||
| } | ||
|
Comment on lines
+202
to
+215
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: #!/bin/bash
# Search for CSS variable definitions and usage patterns
# Check if --color-fg is defined anywhere
echo "=== Searching for --color-fg definition ==="
rg -n '\-\-color-fg' --type=css --type=vue
echo ""
echo "=== Checking main.css for design tokens ==="
fd -t f 'main.css' -x head -100 {}
echo ""
echo "=== Searching for other --color- or --fg patterns ==="
rg -n '\-\-(color-|fg)' --type=css --type=vue | head -30Repository: npmx-dev/npmx.dev Length of output: 3367 🏁 Script executed: #!/bin/bash
# Check for global focus-visible styles in stylesheets
echo "=== Searching for focus-visible styles in main.css ==="
rg -n 'focus-visible' app/assets/main.css
echo ""
echo "=== Searching for focus-visible styles across the codebase ==="
rg -n 'focus-visible' --type=css
echo ""
echo "=== Checking how ::after elements with outlines are styled elsewhere ==="
rg -n '::after.*outline|outline.*::after' --type=cssRepository: npmx-dev/npmx.dev Length of output: 313 🏁 Script executed: #!/bin/bash
# Get context around the focus-visible style in main.css
sed -n '220,235p' app/assets/main.cssRepository: npmx-dev/npmx.dev Length of output: 486 Use the correct CSS variable The variable
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. I agree on this CSS variable usage. I'm also not finding
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.
Based on the design system in
I'd recommend using .row-link {
&::after {
content: '';
position: absolute;
inset: 0;
cursor: pointer;
}
&:focus-visible::after {
outline: 2px solid var(--accent);
outline-offset: -2px;
}
}Would you like me to plan this change for you? 🧠 Learnings used |
||
| </style> | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Why are we not using the Tailwind-ish utility classes in line in the template for this?
I do believe this is not a too crazy thing since it only gets used once.
after:content-[''] after:absolute after:inset-0 after:cursor-pointer focus-visible:after:outline-2 focus-visible:after:outline-offset-[-2px] focus-visible:after:outline-[var(--fg)]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.
this is also a good point