Skip to content

Commit 9c38e89

Browse files
Merge pull request #1982 from appwrite/fix-documents-table-performance
Optimize table rendering with truncation and keying fixes
2 parents 07e7699 + 8271c90 commit 9c38e89

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@appwrite.io/pink-icons": "0.25.0",
2727
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2828
"@appwrite.io/pink-legacy": "^1.0.3",
29-
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@d7e3b86",
29+
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@4e03f34",
3030
"@popperjs/core": "^2.11.8",
3131
"@sentry/sveltekit": "^8.38.0",
3232
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
? `${formattedColumn.slice(0, 20)}...`
9191
: formattedColumn,
9292
truncated: formattedColumn.length > 20,
93-
whole: formattedColumn
93+
whole: `${formattedColumn.slice(0, 100)}...`
9494
};
9595
}
9696
@@ -196,7 +196,7 @@
196196
{/key}
197197
</Table.Cell>
198198

199-
{#each $columns as { id }}
199+
{#each $columns as { id } (id)}
200200
{@const attr = $attributes.find((n) => n.key === id)}
201201
<Table.Cell column={id} {root}>
202202
{#if isRelationship(attr)}
@@ -251,16 +251,21 @@
251251
<span slot="title">Timestamp</span>
252252
{toLocaleDateTime(formatted.whole, true, 'UTC')}
253253
</DualTimeView>
254-
{:else}
254+
{:else if formatted.truncated}
255255
<Tooltip placement="bottom" disabled={!formatted.truncated}>
256256
<Typography.Text truncate>{formatted.value}</Typography.Text>
257257
<span
258+
let:showing
258259
slot="tooltip"
259260
style:white-space="pre-wrap"
260261
style:word-break="break-all">
261-
{formatted.whole}
262+
{#if showing}
263+
{formatted.whole}
264+
{/if}
262265
</span>
263266
</Tooltip>
267+
{:else}
268+
<Typography.Text truncate>{formatted.value}</Typography.Text>
264269
{/if}
265270
{/if}
266271
</Table.Cell>

0 commit comments

Comments
 (0)