Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
},
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@f21fc7f",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@9c55755",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@865e2fc",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bbad65f",
"@appwrite.io/pink-legacy": "^1.0.3",
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@865e2fc",
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@bbad65f",
"@faker-js/faker": "^9.9.0",
"@plausible-analytics/tracker": "^0.4.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify package migration in imports

echo "=== Checking for old 'plausible-tracker' imports ==="
rg -n --type=ts --type=js --type=jsx --type=tsx --type=svelte "from ['\"]plausible-tracker['\"]|import ['\"]plausible-tracker['\"]" || echo "No matches found"

echo ""
echo "=== Checking for new '@plausible-analytics/tracker' imports ==="
rg -n --type=ts --type=js --type=jsx --type=tsx --type=svelte "from ['\"]@plausible-analytics/tracker['\"]|import ['\"]@plausible-analytics/tracker['\"]" || echo "No matches found"

echo ""
echo "=== Checking package.json for both packages ==="
rg -n "plausible" package.json

Repository: appwrite/console

Length of output: 386


🏁 Script executed:

#!/bin/bash
# More comprehensive search for package usage

echo "=== Searching for old 'plausible-tracker' (all patterns) ==="
rg -n "plausible-tracker" --type=ts --type=js --type=svelte 2>/dev/null || echo "No matches found"

echo ""
echo "=== Searching for new '@plausible-analytics/tracker' (all patterns) ==="
rg -n "@plausible-analytics/tracker" --type=ts --type=js --type=svelte 2>/dev/null || echo "No matches found"

echo ""
echo "=== Checking for require() statements ==="
rg -n "require\(['\"].*plausible" --type=ts --type=js --type=svelte 2>/dev/null || echo "No matches found"

echo ""
echo "=== List all source files to understand structure ==="
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.svelte" \) ! -path "*/node_modules/*" ! -path "*/.svelte-kit/*" ! -path "*/dist/*" -print | head -20

Repository: appwrite/console

Length of output: 888


🏁 Script executed:

#!/bin/bash
# Search across all files for any reference to plausible

echo "=== Searching all files for any 'plausible' reference ==="
rg -n "plausible" --type=ts --type=js --type=svelte --type=json 2>/dev/null | grep -v "node_modules" | head -30

echo ""
echo "=== Check analytics-related files ==="
find . -type f \( -name "*analytic*" -o -name "*track*" \) ! -path "*/node_modules/*" ! -path "*/.svelte-kit/*" ! -path "*/dist/*" -print

Repository: appwrite/console

Length of output: 187


🏁 Script executed:

#!/bin/bash
# Examine the analytics file and check package.json more thoroughly

echo "=== Contents of analytics.ts ==="
cat -n ./src/lib/actions/analytics.ts

echo ""
echo "=== Full package.json section around line 31 ==="
sed -n '25,40p' package.json

Repository: appwrite/console

Length of output: 23858


Update the import statement in src/lib/actions/analytics.ts to use the new package name.

The import on line 2 still references 'plausible-tracker', but the package.json dependency has been updated to '@plausible-analytics/tracker'. Update the import to:

import Plausible from '@plausible-analytics/tracker';

The migration is incomplete without this change, and the code will fail at runtime since the old package is no longer a dependency.

🤖 Prompt for AI Agents
In `@package.json` at line 31, Update the import in src/lib/actions/analytics.ts
to match the package.json change: replace the current import from
'plausible-tracker' with an import from '@plausible-analytics/tracker' (e.g.,
import Plausible from '@plausible-analytics/tracker';) so the module name used
by the code (Plausible) matches the installed package and prevents runtime
module not found errors.

"@popperjs/core": "^2.11.8",
"@sentry/sveltekit": "^8.38.0",
"@stripe/stripe-js": "^3.5.0",
Expand All @@ -42,7 +43,6 @@
"ignore": "^6.0.2",
"nanoid": "^5.1.5",
"nanotar": "^0.1.1",
"plausible-tracker": "^0.3.9",
"pretty-bytes": "^6.1.1",
"prismjs": "^1.30.0",
"remarkable": "^2.0.1",
Expand Down
49 changes: 24 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/lib/profiles/css/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.responsive-table {
overflow: hidden;
width: 100%;
scrollbar-width: thin;
position: relative;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@
} from '@appwrite.io/pink-svelte';
import DomainMetrics from './domainMetrics.svelte';
import { base } from '$app/paths';
import { isSmallViewport } from '$lib/stores/viewport';
import { app } from '$lib/stores/app';
import { Button } from '$lib/elements/forms';
import { IconDownload, IconPlus, IconUpload } from '@appwrite.io/pink-icons-svelte';
import {
IconDownload,
IconPlus,
IconUpload,
IconAdjustments
} from '@appwrite.io/pink-icons-svelte';
import DisplaySettingsModal from '$lib/layout/displaySettingsModal.svelte';
import { ViewSelector } from '$lib/components';
import { View } from '$lib/helpers/load';
import { columns, presets } from './store';
Expand All @@ -33,6 +40,7 @@
let showCreate = false;
let showPresetModal = false;
let showImportModal = false;
let showDisplaySettingsModal = false;
let selectedPreset = '';
async function downloadRecords() {
Expand Down Expand Up @@ -70,23 +78,55 @@

<Layout.Stack gap="l">
{#if data.recordList.total}
<Layout.Stack direction="row" justifyContent="space-between">
<Layout.Stack direction="row" gap="s" inline>
<Button secondary on:click={() => (showImportModal = true)}>
<Icon icon={IconUpload} size="s" slot="start" />
Import zone file
<Layout.Stack direction="row" gap="s" alignItems="center" wrap="wrap">
<div style:order={$isSmallViewport ? 2 : undefined}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this order class do? where is it defined?

<Button
secondary
icon={$isSmallViewport}
ariaLabel={$isSmallViewport ? 'Import zone file' : undefined}
on:click={() => (showImportModal = true)}>
{#if $isSmallViewport}
<Icon size="m" icon={IconUpload} />
{:else}
<Icon icon={IconUpload} size="s" slot="start" />
Import zone file
{/if}
</Button>
</div>

<div style:order={$isSmallViewport ? 3 : undefined}>
<Tooltip>
<PinkButton.Button variant="secondary" icon on:click={downloadRecords}>
<Icon icon={IconDownload} size="s" />
<Icon icon={IconDownload} size={$isSmallViewport ? 'm' : 's'} />
</PinkButton.Button>
<svelte:fragment slot="tooltip">Export as .txt</svelte:fragment>
</Tooltip>
</Layout.Stack>
<Layout.Stack direction="row" gap="s" inline>
<ViewSelector ui="new" view={View.Table} {columns} hideView />
</div>
Comment on lines +97 to +104
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add aria-label for accessibility on the icon-only export button.

The Export button is always icon-only and relies solely on the Tooltip for description. Tooltips are not reliably accessible to screen readers. For consistency with the Import button (line 86), add an explicit aria-label.

♿ Proposed fix
 <PinkButton.Button
     variant="secondary"
     icon
+    ariaLabel="Export as .txt"
     on:click={downloadRecords}>
     <Icon icon={IconDownload} size={$isSmallViewport ? 'm' : 's'} />
 </PinkButton.Button>
🤖 Prompt for AI Agents
In
`@src/routes/`(console)/organization-[organization]/domains/domain-[domain]/+page.svelte
around lines 97 - 104, The export button is icon-only and lacks an aria-label;
add an explicit aria-label on the PinkButton.Button that triggers
downloadRecords (the same way the Import button does) so screen readers get a
clear description—update the PinkButton.Button element wrapping IconDownload
(the one using on:click={downloadRecords} and size={$isSmallViewport ? 'm' :
's'}) to include a descriptive aria-label like "Export records" or equivalent.


{#if !$isSmallViewport}
<div style="flex: 1"></div>
{/if}

<div style:order={$isSmallViewport ? 4 : undefined}>
{#if $isSmallViewport}
<Button
secondary
icon
ariaLabel="Display settings"
on:click={() => (showDisplaySettingsModal = true)}>
<Icon icon={IconAdjustments} />
</Button>
{:else}
<ViewSelector ui="new" view={View.Table} {columns} hideView />
{/if}
</div>

<div
style:order={$isSmallViewport ? 1 : undefined}
style:flex={$isSmallViewport ? 1 : undefined}>
<Popover let:toggle padding="none">
<Button secondary on:click={toggle}>Add preset</Button>
<Button secondary fullWidth={$isSmallViewport} on:click={toggle}
>Add preset</Button>
<svelte:fragment slot="tooltip" let:toggle>
<ActionMenu.Root>
{#each presets as preset}
Expand All @@ -100,11 +140,16 @@
</ActionMenu.Root>
</svelte:fragment>
</Popover>
<Button size="s" on:click={() => (showCreate = true)}>
</div>

<div
style:order={$isSmallViewport ? 5 : undefined}
style:width={$isSmallViewport ? '100%' : undefined}>
<Button fullWidth={$isSmallViewport} on:click={() => (showCreate = true)}>
<Icon size="s" icon={IconPlus} slot="start" />
Create record
</Button>
</Layout.Stack>
</div>
</Layout.Stack>
<Table {data} />
{:else}
Expand Down Expand Up @@ -153,3 +198,11 @@
{#if showRetry}
<RetryDomainModal bind:show={showRetry} selectedDomain={data.domain} />
{/if}

{#if showDisplaySettingsModal}
<DisplaySettingsModal
bind:show={showDisplaySettingsModal}
{columns}
hideView
view={View.Table} />
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
</script>

<Layout.Stack>
<Table.Root columns={[...$columns, { id: 'actions', width: 40 }]} let:root>
<Table.Root
class="responsive-table"
columns={[...$columns, { id: 'actions', width: 40 }]}
let:root>
<svelte:fragment slot="header" let:root>
{#each $columns as { id, title } (id)}
<Table.Header.Cell column={id} {root}>
Expand Down
1 change: 1 addition & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { ThemeDark, ThemeLight, ThemeDarkCloud, ThemeLightCloud } from '../themes';
import { isSmallViewport, updateViewport } from '$lib/stores/viewport';
import { feedback } from '$lib/stores/feedback';
import '$lib/profiles/css/base.css';

function resolveTheme(theme: AppStore['themeInUse']) {
switch (theme) {
Expand Down