Change virtual scroller

This commit is contained in:
Andras Schmelczer 2025-01-12 12:00:09 +00:00
parent b61c08041e
commit 0e7acc3b7a
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 27 additions and 32 deletions

View file

@ -42,22 +42,6 @@ openapi-typescript http://localhost:3030/api.json --output plugin/src/services/t
```
```
## Todos
- Add users to vaults
- Websocket for db updates
- async read body
- e2e tests
- add clap
- add auth middleware
- shard db per user
- update card title max width
- retry
- CI for:
- publish reconcile
- cross-platform build server
- run load test on server
- build and publish plugin with openapi types
todo: enable
[workspace.lints.clippy]
@ -79,8 +63,3 @@ apt install flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install flathub md.obsidian.Obsidian
flatpak run md.obsidian.Obsidian
stop leaking subscriptions
test with naughty strings https://github.com/minimaxir/big-list-of-naughty-strings/tree/84a5dea833b5e2218f7c8c2104effca3f8f155aa?tab=readme-ov-file
double check internalSyncRemotelyUpdatedFile

View file

@ -24,7 +24,6 @@
"fetch-retry": "^6.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^11.2.0",
"hyperlist": "^1.0.0",
"jest": "^29.7.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.7.2",
@ -41,6 +40,7 @@
"tslib": "2.4.0",
"typescript": "5.7.2",
"typescript-eslint": "8.18.0",
"virtual-scroller": "^1.13.1",
"webpack": "^5.97.1",
"webpack-cli": "^6.0.1"
}
@ -4522,13 +4522,6 @@
"node": ">=10.17.0"
}
},
"node_modules/hyperlist": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/hyperlist/-/hyperlist-1.0.0.tgz",
"integrity": "sha512-1qAjO29EJW/mPyqY+9wFjruD2YWur1dPsPYmt9RvMX6P+8Cr2UmT75MCWjjK+1/4Jxc3sm/G3Kr8DzGgEDRG+Q==",
"dev": true,
"license": "MIT"
},
"node_modules/icss-utils": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
@ -6638,6 +6631,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/request-animation-frame-timeout": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/request-animation-frame-timeout/-/request-animation-frame-timeout-2.0.4.tgz",
"integrity": "sha512-5oYwRBYjrMSU/YHHXj5AM/nv96ZE0b8WZoA3FqnkeDDPXoprxUCZFK4IWZTl+y3RJQtaihiJPiKOB4NZfZ7C7A==",
"dev": true,
"license": "MIT"
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@ -8072,6 +8072,16 @@
"license": "MIT",
"peer": true
},
"node_modules/virtual-scroller": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/virtual-scroller/-/virtual-scroller-1.13.1.tgz",
"integrity": "sha512-sui46QUBOIfHyXYjdGkxoze/GlCZFUFRxzxEvsu06UQ4iPc3uRfGnm/Qj7195hiMVOYQW9lDn+m3sD7sRMYdYg==",
"dev": true,
"license": "MIT",
"dependencies": {
"request-animation-frame-timeout": "^2.0.3"
}
},
"node_modules/w3c-keyname": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",

View file

@ -35,7 +35,7 @@
"fetch-retry": "^6.0.0",
"file-loader": "^6.2.0",
"fs-extra": "^11.2.0",
"hyperlist": "^1.0.0",
"virtual-scroller": "^1.13.1",
"jest": "^29.7.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.7.2",

View file

@ -34,7 +34,7 @@ export interface HistoryStats {
}
export class SyncHistory {
private static readonly MAX_ENTRIES = 1000;
private static readonly MAX_ENTRIES = 5000;
private readonly entries: HistoryEntry[] = [];

View file

@ -95,6 +95,12 @@ export class HistoryView extends ItemView {
container.empty();
container.createEl("h4", { text: "VaultLink History" });
const virtualScroller = new VirtualScroller(
document.getElementById("messages"),
messages,
renderMessage
);
const entries = this.history
.getEntries()
.reverse()