Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/src/components/cell-detail-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function CellDetailPanel() {
if (!isRightPanelOpen) return null;

return (
<div className="h-svh flex flex-col bg-background border-l w-full">
<div className="h-svh flex flex-col bg-background border-l w-full select-none">
{/* Header */}
<div className="flex items-center justify-end p-4 border-b flex-shrink-0">
{/*<h3 className="text-sm font-semibold">Details</h3>*/}
Expand Down
30 changes: 25 additions & 5 deletions apps/desktop/src/components/scroll-horizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function ScrollHorizontal({ scrollContainerRef, table }: props) {

const [showLeftShadow, setShowLeftShadow] = useState(false);
const [showRightShadow, setShowRightShadow] = useState(false);
const [hasVerticalScrollbar, setHasVerticalScrollbar] = useState(false);

// Calculate the total width of left-pinned columns
const leftPinnedWidth = table.getLeftTotalSize();
Expand All @@ -21,7 +22,10 @@ function ScrollHorizontal({ scrollContainerRef, table }: props) {
const handleScroll = () => {
if (!scrollContainerRef.current) return;

const { scrollLeft, scrollWidth, clientWidth } = scrollContainerRef.current;
const { scrollLeft, scrollWidth, clientWidth, scrollHeight, clientHeight } = scrollContainerRef.current;

// Check if there's vertical overflow (scrollbar present)
setHasVerticalScrollbar(scrollHeight > clientHeight);

// Only show left shadow if scrolled past the pinned columns
setShowLeftShadow(scrollLeft > 0);
Expand Down Expand Up @@ -55,23 +59,39 @@ function ScrollHorizontal({ scrollContainerRef, table }: props) {
<>
{showLeftShadow && (
<div
className="flex items-center absolute top-0 h-full w-6 backdrop-blur-[1.5px] bg-gradient-to-r from-white to-transparent z-50 cursor-pointer"
className="flex items-center absolute top-0 h-full w-20 z-50 cursor-pointer isolate"
style={{
left: `${leftPinnedWidth}px`,
backdropFilter: 'blur(4px)',
WebkitBackdropFilter: 'blur(4px)',
background: 'linear-gradient(to right, hsl(var(--background) / 0.9), transparent)',
maskImage: 'linear-gradient(to right, black 0%, transparent 100%)',
WebkitMaskImage: 'linear-gradient(to right, black 0%, transparent 100%)',
transform: 'translateZ(0)',
willChange: 'transform',
}}
onClick={scrollToLeft}
>
<ChevronLeftIcon />
<ChevronLeftIcon className=" stroke-black" />
</div>
)}

{/* Right shadow */}
{showRightShadow && (
<div
className="flex items-center absolute right-0 top-0 h-full w-6 backdrop-blur-[1.5px] bg-gradient-to-l from-white to-transparent z-50 cursor-pointer"
className={`flex items-center justify-end absolute top-0 h-full w-20 z-50 cursor-pointer isolate ${hasVerticalScrollbar ? 'right-3' : 'right-0'}`}
style={{
backdropFilter: 'blur(4px)',
WebkitBackdropFilter: 'blur(4px)',
background: 'linear-gradient(to left, hsl(var(--background) / 0.9), transparent)',
maskImage: 'linear-gradient(to left, black 0%, transparent 100%)',
WebkitMaskImage: 'linear-gradient(to left, black 0%, transparent 100%)',
transform: 'translateZ(0)',
willChange: 'transform',
}}
onClick={scrollToRight}
>
<ChevronRightIcon />
<ChevronRightIcon className=" stroke-black" />
</div>
)}
</>
Expand Down
7 changes: 4 additions & 3 deletions apps/desktop/src/components/table/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function DataTable() {
}

return (
<div className="flex flex-col w-full h-full relative p-4">
<div className="flex flex-col w-full h-full relative p-4 select-none">
<div className="mb-4 flex-shrink-0">
{/* Advanced Filter Command */}
<div className="mb-4">
Expand Down Expand Up @@ -178,8 +178,9 @@ export function DataTable() {
<TableHeader className="bg-tint-300">
{table.getHeaderGroups().map(headerGroup => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map(header => {
{headerGroup.headers.map((header, index) => {
const isPinned = header.column.getIsPinned();
const isLastHeader = index === headerGroup.headers.length - 1;
return (
<TableHead
{...{
Expand Down Expand Up @@ -212,7 +213,7 @@ export function DataTable() {
onDoubleClick: () => header.column.resetSize(),
onMouseDown: header.getResizeHandler(),
onTouchStart: header.getResizeHandler(),
className: `absolute bottom-2 h-6 cursor-ew-resize -right-2 px-2 z-40`,
className: `absolute bottom-2 h-6 cursor-ew-resize ${!isLastHeader ? '-right-2 px-2' : 'right-2 pl-6'} z-40`,
style: {
transform:
COLUMN_RESIZE_CONFIG.mode === 'onEnd' &&
Expand Down