Skip to content

Commit c96b3b5

Browse files
committed
fix: let diff file tree yield on narrow rows
1 parent 9829cd4 commit c96b3b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/web/src/hooks/useDiffFileTreePanelSize.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function useDiffFileTreePanelSize(row: HTMLDivElement | null): DiffFileTr
3030
return useResizableWidth({
3131
storageKey: FILE_TREE_WIDTH_STORAGE_KEY,
3232
defaultWidth: FILE_TREE_DEFAULT_WIDTH,
33-
minWidth: FILE_TREE_MIN_WIDTH,
33+
minWidth: Math.min(FILE_TREE_MIN_WIDTH, maxWidth),
3434
maxWidth,
3535
edge: "left",
3636
});
@@ -47,7 +47,7 @@ function useRowClampedMaxWidth(row: HTMLDivElement | null): number {
4747
// the row on the initial render, not one observer tick later (the tree
4848
// would flash over-wide on every mount).
4949
const measure = () => {
50-
setMaxWidth(Math.max(FILE_TREE_MIN_WIDTH, Math.floor(row.clientWidth) - CODE_VIEW_MIN_WIDTH));
50+
setMaxWidth(Math.max(0, Math.floor(row.clientWidth) - CODE_VIEW_MIN_WIDTH));
5151
};
5252
measure();
5353
return observeResize(row, () => measure());

0 commit comments

Comments
 (0)