fix(ui): scroll-shadow bottom fade + hide tasks row when nothing active
- ScrollShadow: 1px subpixel tolerance so bottom fade clears at scroll end on Retina (fractional scrollTop was keeping data-bottom-scroll stuck) - StatusRow: hide tasks indicator when no in-progress/pending todos remain
This commit is contained in:
@@ -200,7 +200,7 @@ export const StatusRow: React.FC<StatusRowProps> = ({
|
||||
return { active, left };
|
||||
}, [visibleTodos]);
|
||||
|
||||
const hasTodoContent = showTodos && visibleTodos.length > 0;
|
||||
const hasTodoContent = showTodos && statusSummary.left > 0;
|
||||
const hasAssistantContent = showAssistantStatus && (
|
||||
isWorking ||
|
||||
Boolean(wasAborted) ||
|
||||
|
||||
@@ -89,11 +89,18 @@ export const ScrollShadow = React.forwardRef<HTMLElement, ScrollShadowProps>(
|
||||
return;
|
||||
}
|
||||
|
||||
const hasBefore = orientation === "vertical" ? el.scrollTop > offset : el.scrollLeft > offset;
|
||||
// Subpixel tolerance: on hi-DPI (Retina) and with fractional scrollTop,
|
||||
// scrollTop+clientHeight can fall ~0.5px short of scrollHeight at the very end,
|
||||
// which would otherwise keep the bottom fade visible after fully scrolling.
|
||||
const SUBPIXEL_TOLERANCE = 1;
|
||||
const hasBefore =
|
||||
orientation === "vertical"
|
||||
? el.scrollTop > offset + SUBPIXEL_TOLERANCE
|
||||
: el.scrollLeft > offset + SUBPIXEL_TOLERANCE;
|
||||
let hasAfter =
|
||||
orientation === "vertical"
|
||||
? el.scrollTop + el.clientHeight + offset < el.scrollHeight
|
||||
: el.scrollLeft + el.clientWidth + offset < el.scrollWidth;
|
||||
? el.scrollHeight - (el.scrollTop + el.clientHeight) > offset + SUBPIXEL_TOLERANCE
|
||||
: el.scrollWidth - (el.scrollLeft + el.clientWidth) > offset + SUBPIXEL_TOLERANCE;
|
||||
|
||||
const effectiveHasBefore = hideTopShadow && orientation === "vertical" ? false : hasBefore;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user