1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-07-02 19:52:47 +03:00

Compare commits

..

5 Commits

Author SHA1 Message Date
xfox111 4bdab6acea feat(wip): virtualized collections list #235 2026-06-04 16:08:14 +12:00
xfox111 54844c54d5 build: 3.3.2 version bump 2026-06-03 07:53:24 +00:00
xfox111 46f613f295 build(deps): audit fix 2026-06-03 07:51:58 +00:00
dependabot[bot] 01340f6aef build(deps): Bump the deps group with 8 updates (#237)
* Bump the deps group with 8 updates

Bumps the deps group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [@fluentui/react-components](https://github.com/microsoft/fluentui) | `9.73.8` | `9.74.1` |
| [@fluentui/react-icons](https://github.com/microsoft/fluentui-system-icons) | `2.0.326` | `2.0.328` |
| [@webext-core/messaging](https://github.com/aklinker1/webext-core/tree/HEAD/packages/messaging) | `2.3.0` | `3.0.1` |
| [@eslint/css](https://github.com/eslint/css) | `0.14.1` | `1.3.0` |
| [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.39.4` | `10.0.1` |
| [@eslint/json](https://github.com/eslint/json) | `0.14.0` | `2.0.0` |
| [eslint](https://github.com/eslint/eslint) | `9.39.4` | `10.4.1` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.59.3` | `8.60.0` |


Updates `@fluentui/react-components` from 9.73.8 to 9.74.1
- [Release notes](https://github.com/microsoft/fluentui/releases)
- [Commits](https://github.com/microsoft/fluentui/commits/@fluentui/react-components_v9.74.1)

Updates `@fluentui/react-icons` from 2.0.326 to 2.0.328
- [Changelog](https://github.com/microsoft/fluentui-system-icons/blob/main/docs/releases.md)
- [Commits](https://github.com/microsoft/fluentui-system-icons/commits)

Updates `@webext-core/messaging` from 2.3.0 to 3.0.1
- [Release notes](https://github.com/aklinker1/webext-core/releases)
- [Changelog](https://github.com/aklinker1/webext-core/blob/main/packages/messaging/CHANGELOG.md)
- [Commits](https://github.com/aklinker1/webext-core/commits/messaging-v3.0.1/packages/messaging)

Updates `@eslint/css` from 0.14.1 to 1.3.0
- [Release notes](https://github.com/eslint/css/releases)
- [Changelog](https://github.com/eslint/css/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/css/compare/css-v0.14.1...css-v1.3.0)

Updates `@eslint/js` from 9.39.4 to 10.0.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v10.0.1/packages/js)

Updates `@eslint/json` from 0.14.0 to 2.0.0
- [Release notes](https://github.com/eslint/json/releases)
- [Changelog](https://github.com/eslint/json/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/json/compare/json-v0.14.0...json-v2.0.0)

Updates `eslint` from 9.39.4 to 10.4.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.4...v10.4.1)

Updates `typescript-eslint` from 8.59.3 to 8.60.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.60.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@fluentui/react-components"
  dependency-version: 9.74.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: deps
- dependency-name: "@fluentui/react-icons"
  dependency-version: 2.0.328
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: deps
- dependency-name: "@webext-core/messaging"
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: "@eslint/css"
  dependency-version: 1.3.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: "@eslint/js"
  dependency-version: 10.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: "@eslint/json"
  dependency-version: 2.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: eslint
  dependency-version: 10.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: typescript-eslint
  dependency-version: 8.60.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(deps): eslint-plugin-react incompatible with eslint 10

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eugene Fox <eugene@xfox111.net>
2026-06-03 19:48:38 +12:00
dependabot[bot] b4a454f463 build(deps): Bump the react group across 1 directory with 3 updates (#239)
Bumps the react group with 3 updates in the / directory: [react](https://github.com/facebook/react/tree/HEAD/packages/react), [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom).


Updates `react` from 19.2.6 to 19.2.7
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.7/packages/react)

Updates `@types/react` from 19.2.14 to 19.2.16
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `react-dom` from 19.2.6 to 19.2.7
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.7/packages/react-dom)

Updates `@types/react` from 19.2.14 to 19.2.16
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: react
  dependency-version: 19.2.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: react
- dependency-name: "@types/react"
  dependency-version: 19.2.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: react
- dependency-name: react-dom
  dependency-version: 19.2.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: react
- dependency-name: "@types/react"
  dependency-version: 19.2.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: react
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-03 19:02:01 +12:00
7 changed files with 989 additions and 1489 deletions
+5 -6
View File
@@ -32,13 +32,12 @@ Check out our [latest blog post](https://at.xfox111.net/tabs-aside-3-0) regardin
- Ukrainian
## Download
[![Chrome web store](https://img.shields.io/chrome-web-store/users/mgmjbodjgijnebfgohlnjkegdpbdjgin?label=Chrome%20webstore%20users)](https://chrome.google.com/webstore/detail/mgmjbodjgijnebfgohlnjkegdpbdjgin)
[![Firefox Browser Add-ons](https://img.shields.io/amo/users/ms-edge-tabs-aside?label=Firefox%20Browser%20Add-ons%20users)](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
[![Edge Add-ons](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fkmnblllmalkiapkfknnlpobmjjdnlhnd&query=%24.activeInstallCount&label=Edge%20Add-ons%20users)](https://microsoftedge.microsoft.com/addons/detail/kmnblllmalkiapkfknnlpobmjjdnlhnd)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/users/mgmjbodjgijnebfgohlnjkegdpbdjgin?label=Chrome%20Webstore%20downloads)](https://chrome.google.com/webstore/detail/mgmjbodjgijnebfgohlnjkegdpbdjgin)
[![Mozilla Add-on](https://img.shields.io/amo/users/ms-edge-tabs-aside?label=Firefox%20Webstore%20downloads)](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
- [Chrome web store](https://chrome.google.com/webstore/detail/mgmjbodjgijnebfgohlnjkegdpbdjgin)
- [Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/kmnblllmalkiapkfknnlpobmjjdnlhnd)
- [Firefox Browser Add-ons](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
- [Google Chrome Webstore](https://chrome.google.com/webstore/detail/mgmjbodjgijnebfgohlnjkegdpbdjgin)
- [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/kmnblllmalkiapkfknnlpobmjjdnlhnd)
- [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
- [GitHub Releases](https://github.com/xfox111/TabsAsideExtension/releases/latest)
### Sideloading (for testing purposes only)
+98
View File
@@ -0,0 +1,98 @@
export default function VirtualList<T>(props: VirtualListProps<T>): React.ReactElement
{
const [columns, setColumns] = useState<number>(1);
const [rowsToRender, setRowsToRender] = useState<number>(0);
const [rowIndex, setRowIndex] = useState<number>(0);
const additionalRows = 3;
const heights: number[] = useMemo(() =>
{
if (typeof props.itemHeight === "number")
return props.items.map(() => props.itemHeight as number);
return props.items.map(props.itemHeight);
}, [props.items, props.itemHeight]);
const minHeight: number = Math.min(...heights);
const totalRows: number = Math.ceil(props.items.length / columns);
const takeCount: number = rowsToRender * columns;
const renderStartIndex: number = rowIndex * columns;
const paddingTop: number = calculateHeight(heights, 0, rowIndex, columns);
const paddingBottom: number = calculateHeight(heights, rowIndex + rowsToRender, totalRows, columns);
const renderedItems = props.items.slice(renderStartIndex, renderStartIndex + takeCount);
useEffect(() =>
{
const container = document.querySelector(props.containerSelector);
const handleResize = (): void =>
{
if (!container)
return;
const newRowsToRender: number = Math.ceil(container.clientHeight / minHeight) + additionalRows;
setRowsToRender(newRowsToRender);
if (!props.columnMinWidth)
{
setColumns(1);
return;
}
const newColumns: number = Math.floor((container.clientWidth - (props.horizontalOffset ?? 0)) / (props.columnMinWidth));
setColumns(Math.max(1, newColumns));
};
handleResize();
const handleScroll = (e: Event): void =>
{
const target = e.target as HTMLElement;
const topOffset: number = target.scrollHeight - calculateHeight(heights, 0, totalRows, columns);
const scrollTop: number = Math.max(0, target.scrollTop - topOffset);
const newIndex: number = Math.floor(scrollTop / minHeight - Math.floor(additionalRows / 2));
console.log("scroll", scrollTop, newIndex);
setRowIndex(Math.max(0, newIndex));
};
container?.addEventListener("scroll", handleScroll);
window.addEventListener("resize", handleResize);
return () =>
{
container?.removeEventListener("scroll", handleScroll);
window.removeEventListener("resize", handleResize);
};
}, [totalRows, props.columnMinWidth, props.horizontalOffset, heights, columns]);
return (
<section tabIndex={ 0 } style={ { paddingTop, paddingBottom } } className={ props.className }>
{ renderedItems.map((item, index) => props.itemRenderer(item, rowIndex * columns + index)) }
</section>
);
}
export type VirtualListProps<T> = {
className?: string;
itemHeight: number | ((item: T, index: number) => number);
containerSelector: string;
horizontalOffset?: number;
columnMinWidth?: number;
items: T[];
itemRenderer: (item: T, index: number) => React.ReactElement;
};
function calculateHeight(heights: number[], rowStart: number, rowEnd: number, columns: number): number
{
let height = 0;
for (let i = rowStart; i < rowEnd; i++)
{
const rowHeights = heights.slice(i * columns, (i + 1) * columns);
height += Math.max(...rowHeights);
}
return height;
}
@@ -45,7 +45,37 @@ export default function CollectionsProvider({ children }: React.PropsWithChildre
const addCollection = async (collection: CollectionItem): Promise<void> =>
{
await updateStorage([collection, ...collections]);
// TEMP
// await updateStorage([collection, ...collections]);
const items: CollectionItem[] = [];
for (let i = 0; i < 128; i++)
items.push({
title: i.toString(),
items: [
{
type: "tab",
title: "Google",
url: "https://www.google.com"
},
{
type: "group",
title: "Group",
color: "blue",
items: [
{
type: "tab",
title: "Facebook",
url: "https://www.facebook.com"
}
]
}
],
timestamp: Date.now() + i,
type: "collection"
});
await updateStorage(items);
};
const removeItem = async (...indices: number[]): Promise<void> =>
@@ -22,6 +22,8 @@ import { snapHandleToCursor } from "../../utils/dnd/snapHandleToCursor";
import { useStyles_CollectionListView } from "./CollectionListView.styles";
import SearchBar from "./SearchBar";
import StorageCapacityIssueMessage from "./messages/StorageCapacityIssueMessage";
import VirtualList from "@/components/VirtualList";
import calculateCollectionHeight from "../../utils/calculateCollectionHeight";
export default function CollectionListView(): ReactElement
{
@@ -60,6 +62,8 @@ export default function CollectionListView(): ReactElement
setShowHidden(newShowHidden);
}, []);
// FIXME: disable drag and drop if filters are active!!!
const handleDragStart = (event: DragStartEvent): void =>
{
setActive(event.active.data.current as DndItem);
@@ -115,7 +119,55 @@ export default function CollectionListView(): ReactElement
</Button>
</div>
:
<section className={ mergeClasses(cls.collectionList, !tilesView && cls.listView, !!(!tilesView && compactView) && cls.compactList) }>
<DndContext
sensors={ sensors }
collisionDetection={ collisionDetector(!tilesView) }
onDragStart={ handleDragStart }
onDragEnd={ handleDragEnd }
modifiers={ [snapHandleToCursor] }
>
<SortableContext
items={ resultList.map((_, index) => index.toString()) }
strategy={ tilesView ? verticalListSortingStrategy : rectSortingStrategy }
>
<VirtualList
className={ mergeClasses(cls.collectionList, !tilesView && cls.listView, !!(!tilesView && compactView) && cls.compactList) }
itemHeight={ item => calculateCollectionHeight(item, tilesView, compactView ?? true) }
horizontalOffset={ 32 }
columnMinWidth={ !tilesView ? 360 : undefined }
items={ resultList }
containerSelector="article"
itemRenderer={ (item, index) =>
<CollectionView key={ item.timestamp } collection={ item } index={ index } compact={ compactView } />
} />
</SortableContext>
<DragOverlay dropAnimation={ null }>
{ active !== null ?
active.item.type === "collection" ?
<CollectionView collection={ active.item } index={ -1 } dragOverlay />
:
<CollectionContext.Provider
value={ {
tabCount: 0,
collection: resultList[active.indices[0]],
hasPinnedGroup: true
} }
>
{ active.item.type === "group" ?
<GroupView group={ active.item } indices={ [-1] } collectionId={ -1 } dragOverlay />
:
<TabView tab={ active.item } indices={ [-1] } collectionId={ -1 } dragOverlay />
}
</CollectionContext.Provider>
:
<></>
}
</DragOverlay>
</DndContext>
/* <section className={ mergeClasses(cls.collectionList, !tilesView && cls.listView, !!(!tilesView && compactView) && cls.compactList) }>
<DndContext
sensors={ sensors }
collisionDetection={ collisionDetector(!tilesView) }
@@ -155,7 +207,7 @@ export default function CollectionListView(): ReactElement
}
</DragOverlay>
</DndContext>
</section>
</section> */
}
</article>
);
@@ -0,0 +1,37 @@
import { CollectionItem, GroupItem } from "@/models/CollectionModels";
export default function calculateCollectionHeight(collection: CollectionItem, tilesView: boolean, compactView: boolean): number
{
if (compactView)
return collection.color ? 69.2 : 67.6;
if (collection.items.length < 1)
return collection.color ? 217.6 : 219.2;
if (tilesView)
{
let height = 201.6;
if (collection.items.some(i => i.type === "group"))
height = 242.4;
if (collection.color)
height += 1.6;
return height;
}
else
{
let baseHeight: number = collection.color ? 81.2 : 79.6;
baseHeight += 39.6 * collection.items.flatMap(i => i.type === "group" ? i.items : [i]).length - 6;
const groups: GroupItem[] = collection.items.filter(i => i.type === "group");
for (const group of groups)
baseHeight += group.items.length < 1 ? 126 : 50;
return Math.min(baseHeight, 572);
}
}
+746 -1470
View File
File diff suppressed because it is too large Load Diff
+18 -10
View File
@@ -1,7 +1,7 @@
{
"name": "tabs-aside",
"private": true,
"version": "3.3.1",
"version": "3.3.2",
"type": "module",
"scripts": {
"dev": "wxt",
@@ -16,27 +16,35 @@
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@fluentui/react-components": "^9.73.8",
"@fluentui/react-icons": "^2.0.326",
"@webext-core/messaging": "^2.3.0",
"@fluentui/react-components": "^9.74.1",
"@fluentui/react-icons": "^2.0.328",
"@webext-core/messaging": "^3.0.1",
"@wxt-dev/analytics": "^0.5.4",
"@wxt-dev/i18n": "^0.2.5",
"lzutf8": "^0.6.3",
"react": "^19.2.6",
"react-dom": "^19.2.6"
"react": "^19.2.7",
"react-dom": "^19.2.7"
},
"devDependencies": {
"@eslint/css": "^0.14.1",
"@eslint/css": "^1.3.0",
"@eslint/js": "^9.39.4",
"@eslint/json": "^0.14.0",
"@eslint/json": "^2.0.0",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/react": "^19.2.14",
"@types/react": "^19.2.16",
"@types/react-dom": "^19.2.3",
"@wxt-dev/module-react": "^1.2.2",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.37.5",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.3",
"typescript-eslint": "^8.60.0",
"wxt": "^0.20.26"
},
"overrides": {
"node-notifier": {
"uuid": "^11.1.1"
},
"web-ext-run": {
"tmp": "^0.2.6"
}
}
}