Skip to content

Commit f168faf

Browse files
committed
Middle click to open cell in new tab
1 parent 9a8f2cb commit f168faf

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"highlight.js": "11.10.0",
26-
"hightable": "0.6.0",
26+
"hightable": "0.6.1",
2727
"hyparquet": "1.5.0",
2828
"hyparquet-compressors": "0.1.4"
2929
},
@@ -34,7 +34,7 @@
3434
"@rollup/plugin-terser": "0.4.4",
3535
"@rollup/plugin-typescript": "12.1.1",
3636
"@testing-library/react": "16.0.1",
37-
"@types/node": "22.7.9",
37+
"@types/node": "22.8.1",
3838
"@types/react": "18.3.12",
3939
"@types/react-dom": "18.3.1",
4040
"@vitejs/plugin-react": "4.3.3",

public/build/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/app.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/viewers/ParquetView.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ export default function ParquetView({ file, setProgress, setError }: ViewerProps
6161
location.href = '/files?key=' + file + '&row=' + row + '&col=' + col
6262
}, [file])
6363

64+
const onMouseDownCell = useCallback((event: React.MouseEvent, col: number, row: number) => {
65+
if (event.button === 1) {
66+
// Middle click open in new tab
67+
event.preventDefault()
68+
window.open('/files?key=' + file + '&row=' + row + '&col=' + col, '_blank')
69+
}
70+
}, [file])
71+
6472
const headers = <>
6573
{content?.dataframe && <span>{content.dataframe.numRows.toLocaleString()} rows</span>}
6674
</>
@@ -70,6 +78,7 @@ export default function ParquetView({ file, setProgress, setError }: ViewerProps
7078
cacheKey={url}
7179
data={content.dataframe}
7280
onDoubleClickCell={onDoubleClickCell}
81+
onMouseDownCell={onMouseDownCell}
7382
onError={setError} />}
7483

7584
{loading && <Spinner className='center' />}

0 commit comments

Comments
 (0)