Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Fix: UI panel - refrow overflow

Blue Mouse3f1b03794da6
diff --git a/web/app/pages/Project/View/Panels.tsx b/web/app/pages/Project/View/Panels.tsx
index 06c5f7842..cbee456b7 100644
--- a/web/app/pages/Project/View/Panels.tsx
+++ b/web/app/pages/Project/View/Panels.tsx
@@ -1669,14 +1669,14 @@ const Panel = ({
>
{rowData}
{!hideFilters && (
- <FunnelIcon className='ml-2 hidden h-4 w-4 text-gray-500 group-hover:block dark:text-gray-300' />
+ <FunnelIcon className='min-h-4 ml-2 hidden size-4 min-w-4 text-gray-500 group-hover:block dark:text-gray-300' />
)}
</a>
) : (
<span className={cx('label flex items-center', { capitalize })}>
{rowData}
{!hideFilters && (
- <FunnelIcon className='ml-2 hidden h-4 w-4 text-gray-500 group-hover:block dark:text-gray-300' />
+ <FunnelIcon className='min-h-4 ml-2 hidden size-4 min-w-4 text-gray-500 group-hover:block dark:text-gray-300' />
)}
</span>
)}
diff --git a/web/app/pages/Project/View/components/RefRow.tsx b/web/app/pages/Project/View/components/RefRow.tsx
index 16c3df62f..b97645c5c 100644
--- a/web/app/pages/Project/View/components/RefRow.tsx
+++ b/web/app/pages/Project/View/components/RefRow.tsx
@@ -1,29 +1,31 @@
-import React, { memo } from 'react'
-import _isEmpty from 'lodash/isEmpty'
+import { memo, useMemo } from 'react'
const RefRow = ({ rowName }: { rowName: string }): JSX.Element => {
- let isUrl: boolean = true
- let url: URL | null = null
+ const { isUrl, url } = useMemo(() => {
+ try {
+ const urlObj = new URL(rowName)
+ return { isUrl: true, url: urlObj }
+ } catch {
+ return { isUrl: false, url: null }
+ }
+ }, [rowName])
- try {
- url = new URL(rowName) as URL
- } catch {
- isUrl = false
- }
+ const linkClassName = 'text-blue-600 hover:underline dark:text-blue-500'
return (
- <div className='overflow-auto'>
- {isUrl && !_isEmpty(url?.hostname) && (
+ <div className='scrollbar-thin hover-always:overflow-auto overflow-hidden'>
+ {isUrl && (
<img
- className='float-left mr-1.5 h-5 w-5'
+ className='float-left mr-1.5 size-5'
src={`https://icons.duckduckgo.com/ip3/${url?.hostname}.ico`}
+ loading='lazy'
alt=''
aria-hidden='true'
/>
)}
{isUrl ? (
<a
- className='label flex text-blue-600 hover:underline dark:text-blue-500'
+ className={linkClassName}
href={rowName}
target='_blank'
rel='noopener noreferrer nofollow'
@@ -33,7 +35,7 @@ const RefRow = ({ rowName }: { rowName: string }): JSX.Element => {
{rowName}
</a>
) : (
- <span className='label flex text-blue-600 hover:underline dark:text-blue-500'>{rowName}</span>
+ <span className={linkClassName}>{rowName}</span>
)}
</div>
)
diff --git a/web/tailwind.config.ts b/web/tailwind.config.ts
index 18269dc4d..fc8b551db 100644
--- a/web/tailwind.config.ts
+++ b/web/tailwind.config.ts
@@ -1,4 +1,5 @@
import type { Config } from 'tailwindcss'
+import plugin from 'tailwindcss/plugin'
export default {
mode: 'jit',
@@ -58,5 +59,17 @@ export default {
extend: {},
scrollBehavior: ['motion-safe', 'motion-reduce', 'responsive'],
},
- plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],
+ plugins: [
+ require('@tailwindcss/forms'),
+ require('@tailwindcss/typography'),
+ plugin(({ addVariant, addUtilities, matchVariant }) => {
+ addVariant('has-hover', '@media (hover: hover) and (pointer: fine)')
+ addVariant('no-hover', '@media not all and (hover: hover) and (pointer: fine)')
+
+ addVariant('hover-always', [
+ '@media (hover: hover) and (pointer: fine) { &:hover }',
+ '@media not all and (hover: hover) and (pointer: fine)',
+ ])
+ }),
+ ],
} satisfies Config