Skip to content

Commit e5a50d9

Browse files
committed
Update README and fix UploadQueueWidget re-rendering
Added a call-to-action link and updated the main screenshot in README.md. In UploadQueueWidget.tsx, set a dynamic key on the Virtuoso list to ensure proper re-rendering when tasks or collapsed state change. Minor cleanup to computeItemKey usage.
2 parents ed278f3 + 6dfb0d6 commit e5a50d9

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
[![Docker Image Size](https://badgen.net/docker/size/bvdcode/cotton?icon=docker&label=size)](https://hub.docker.com/r/bvdcode/cotton)
99
[![Github last-commit](https://img.shields.io/github/last-commit/bvdcode/cotton)](https://github.com/bvdcode/cotton/commits/main/)
1010

11-
> ⚠️ **Project status: Beta.**
12-
> Breaking changes and rough edges are expected.
11+
> **[Using Cotton? Say hi here!](https://github.com/bvdcode/cotton/discussions/3)**
1312
> Live demo: [cotton.splidex.com](https://cotton.splidex.com/)
1413
1514
<div align="center">
@@ -23,7 +22,8 @@
2322
</div>
2423

2524

26-
<img width="1379" height="846" alt="image" src="https://github.com/user-attachments/assets/99f9c587-7ac6-43a4-9c33-50bdafd136d9" />
25+
<img width="1379" height="846" alt="image" src="https://github.com/user-attachments/assets/35668eb2-049e-4be9-8739-6d603a026b9f" />
26+
2727

2828

2929
---

src/cotton.client/src/app/layouts/components/UploadQueueWidget.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ export const UploadQueueWidget = () => {
101101
>
102102
{tasks.length > 0 && (
103103
<Virtuoso
104+
key={`${tasks.length}-${tasks[0]?.id ?? "none"}-${isCollapsed ? "collapsed" : "expanded"}`}
105+
className="upload-queue-widget__list"
104106
style={{ height: listHeight }}
105107
data={tasks}
106-
computeItemKey={(_index, task) => task.id}
107-
totalCount={tasks.length}
108108
overscan={5}
109+
computeItemKey={(_, task) => task.id}
109110
itemContent={(index, task) => (
110111
<Box px={1.5}>
111112
<UploadTaskRow task={task} showDivider={index > 0} />

0 commit comments

Comments
 (0)