Skip to content

Conversation

@hmacr
Copy link
Contributor

@hmacr hmacr commented Jan 5, 2026

Closes SER-722

Summary by CodeRabbit

  • New Features

    • Added an "Updated" column in domain tables showing status labels ("Checked", "Updated", "Failed") with relative timestamps.
  • Improvements

    • Domain lists now sort by most-recently-updated first.
    • Relative time labels shortened (e.g., "sec", "min", "hr") and invalid/missing times display as "n/a".

✏️ Tip: You can customize this high-level summary in your review settings.

@hmacr hmacr requested a review from ItzNotABug January 5, 2026 08:11
@appwrite
Copy link

appwrite bot commented Jan 5, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Sites auto-generate unique domains with the pattern https://randomstring.appwrite.network

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Walkthrough

Adds a new exported helper timeFromNowShort(datetime: string): string that returns n/a for null/empty or invalid dates and otherwise returns a relative time string with units abbreviated (sec, min, hr). Introduces an updated column to multiple domain store files. Table components import timeFromNowShort, add an updatedLabel(proxyRule) helper that maps statuses (created -> "Checked", verifying -> "Updated", unverified -> "Failed", verified -> "") and appends the shortened relative time, and render that label for non-verified rules. Several domain page queries now include Query.orderDesc('$updatedAt') to sort results by updated time descending.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a feature to display the last checked time for domain verification across multiple domain management pages.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (4)
src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte (2)

73-80: Duplicate status label mapping.

This is the same logic flagged in the functions domain table. See the earlier comment for the recommended refactor to extract this to a shared helper function.


134-142: Verify empty cell behavior for verified domains.

Same consideration as in the functions domain table - confirm that empty cells for verified domains is intentional.

src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte (2)

66-73: Duplicate status label mapping.

This is the same logic flagged in the functions domain table. See the earlier comment for the recommended refactor to extract this to a shared helper function.


129-137: Verify empty cell behavior for verified domains.

Same consideration as in the functions domain table - confirm that empty cells for verified domains is intentional.

🧹 Nitpick comments (3)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts (1)

20-25: Consider adding a descriptive column title.

The new 'updated' column has an empty title. While this might be intentional for UI layout purposes (especially if the column displays status-prefixed timestamps), consider adding a descriptive title like 'Last Checked' or 'Status' for better accessibility and user clarity.

🔎 Suggested column title
 {
     id: 'updated',
-    title: '',
+    title: 'Last Checked',
     type: 'string',
     width: { min: 160, max: 180 }
 }
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte (1)

66-73: Consider extracting the status label mapping to a shared helper.

The updatedLabel logic is duplicated across three domain table files (functions, settings, and sites). Extracting this to a shared helper function would improve maintainability.

🔎 Proposed refactor

Create a new helper in src/lib/helpers/domain.ts (or similar):

export function getUpdatedLabel(status: string): string {
    switch (status) {
        case 'created':
            return 'Checked';
        case 'verifying':
            return 'Updated';
        case 'unverified':
            return 'Failed';
        default:
            return '';
    }
}

Then update this file and the other two table files:

-{@const updatedLabel =
-    proxyRule.status === 'created'
-        ? 'Checked'
-        : proxyRule.status === 'verifying'
-          ? 'Updated'
-          : proxyRule.status === 'unverified'
-            ? 'Failed'
-            : ''}
+{@const updatedLabel = getUpdatedLabel(proxyRule.status)}
src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte (1)

49-55: Column definition inconsistency with other domain tables.

This file defines the updated column inline within the local columns array, while the functions and sites domain tables use a separate store.ts file. Consider extracting to a store file for consistency, or document why this approach differs.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebda2b7 and 3421f7b.

📒 Files selected for processing (9)
  • src/lib/helpers/date.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/lib/helpers/date.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
src/lib/helpers/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Implement pure functions in src/lib/helpers/ directory and use camelCase for helper function names

Files:

  • src/lib/helpers/date.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Define types inline or in .d.ts files, avoid creating separate .types.ts files
Use TypeScript in non-strict mode; any type is tolerated in this project

Files:

  • src/lib/helpers/date.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/lib/helpers/date.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Configure dynamic routes using SvelteKit convention with [param] syntax in route directory names

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
src/routes/**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]

Files:

  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use Svelte 5 + SvelteKit 2 syntax with TypeScript for component development

Files:

  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
🧠 Learnings (1)
📚 Learning: 2025-09-30T07:41:06.679Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2425
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte:454-468
Timestamp: 2025-09-30T07:41:06.679Z
Learning: In `src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte`, the column suggestions API (console.suggestColumns) has a maximum limit of 7 columns returned, which aligns with the initial placeholder count of 7 in customColumns.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/store.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (6)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.ts (1)

32-32: LGTM!

The addition of Query.orderDesc('$updatedAt') provides secondary sorting by the updated timestamp, which aligns with the PR objective to show last checked time for domain verification.

src/lib/helpers/date.ts (1)

209-222: LGTM!

The timeFromNowShort function correctly abbreviates time units for compact display. The replace calls work properly because dayjs returns only one time unit per string, and the replacements handle both singular and plural forms (e.g., 'second' matches within 'seconds').

src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.ts (1)

31-31: LGTM!

The addition of Query.orderDesc('$updatedAt') is consistent with the same change in the functions domains page, providing uniform sorting behavior across domain management tables.

src/routes/(console)/project-[region]-[project]/settings/domains/+page.ts (1)

24-28: Add pagination and filtering parameters to match the domain listing pages for functions and sites.

The queries array is missing essential parameters that similar listing pages include:

  • Query.limit(limit) and Query.offset(offset) for pagination
  • Query.orderDesc('') for secondary ordering
  • ...parsedQueries.values() to apply user-provided filters

The functions and sites domain pages include all these parameters despite having similar structure. Without them, the settings domain page will ignore pagination choices and filter parameters, breaking consistency with other listing pages.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/store.ts (1)

20-25: LGTM!

The new 'updated' column definition is correctly structured with appropriate width constraints for displaying timestamp information.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte (1)

129-137: Verify that empty cells for verified domains is the intended UX.

The updated column only renders content when proxyRule.status !== 'verified'. This means verified domains will display an empty cell in this column. Confirm this is the desired behavior rather than showing something like "Verified [timestamp]" or hiding the column entirely.

@hmacr hmacr requested a review from ItzNotABug January 5, 2026 08:21
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte (1)

51-66: Simplify the nested ternary for improved readability.

The nested ternary operator (lines 56-63) can be simplified using an object map for better readability without changing behavior.

Proposed refactor
    function updatedLabel(proxyRule: Models.ProxyRule): string {
        if (proxyRule.status === 'verified') {
            return '';
        }

-        const prefix =
-            proxyRule.status === 'created'
-                ? 'Checked'
-                : proxyRule.status === 'verifying'
-                  ? 'Updated'
-                  : proxyRule.status === 'unverified'
-                    ? 'Failed'
-                    : '';
+        const statusPrefixMap = {
+            created: 'Checked',
+            verifying: 'Updated',
+            unverified: 'Failed'
+        };
+        const prefix = statusPrefixMap[proxyRule.status] || '';

         return prefix + ' ' + timeFromNowShort(proxyRule.$updatedAt);
     }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3421f7b and bee07a3.

📒 Files selected for processing (3)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
src/routes/**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]

Files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use Svelte 5 + SvelteKit 2 syntax with TypeScript for component development

Files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Configure dynamic routes using SvelteKit convention with [param] syntax in route directory names

Files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (2)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte (2)

28-28: LGTM!

The import follows the coding guidelines by using the $lib alias correctly.


138-146: LGTM!

The rendering logic correctly displays the updated timestamp only for non-verified domains. The right-aligned layout and tertiary color styling are appropriate for this supplementary information.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte (1)

51-71: LGTM with optional refactor suggestion.

The logic correctly handles all status cases and appropriately returns an empty string for verified domains or invalid timestamps.

Optional: The nested ternary for status mapping (lines 61-68) could be refactored to a switch statement or object lookup for slightly better readability:

🔎 Optional refactor using object lookup
-    const prefix =
-        proxyRule.status === 'created'
-            ? 'Checked'
-            : proxyRule.status === 'verifying'
-              ? 'Updated'
-              : proxyRule.status === 'unverified'
-                ? 'Failed'
-                : '';
+    const statusLabels = {
+        created: 'Checked',
+        verifying: 'Updated',
+        unverified: 'Failed'
+    };
+    const prefix = statusLabels[proxyRule.status] ?? '';
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bee07a3 and 1460dae.

📒 Files selected for processing (4)
  • src/lib/helpers/date.ts
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/table.svelte
  • src/routes/(console)/project-[region]-[project]/settings/domains/table.svelte
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/lib/helpers/date.ts
src/routes/**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
  • src/lib/helpers/date.ts
**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use Svelte 5 + SvelteKit 2 syntax with TypeScript for component development

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Configure dynamic routes using SvelteKit convention with [param] syntax in route directory names

Files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte
src/lib/helpers/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Implement pure functions in src/lib/helpers/ directory and use camelCase for helper function names

Files:

  • src/lib/helpers/date.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Define types inline or in .d.ts files, avoid creating separate .types.ts files
Use TypeScript in non-strict mode; any type is tolerated in this project

Files:

  • src/lib/helpers/date.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e
  • GitHub Check: build
🔇 Additional comments (2)
src/lib/helpers/date.ts (1)

209-219: Verify that longer time periods should remain unabbreviated.

The function only abbreviates seconds, minutes, and hours but leaves days, weeks, months, and years in their full form. This is likely intentional for domain verification timestamps (which are checked frequently), but please confirm this behavior aligns with the UI requirements.

The implementation correctly handles both singular and plural forms (e.g., "second" → "sec", "seconds" → "secs") and appropriately returns n/a for invalid inputs.

Minor note: The inline comments explaining the replacements could be removed per the coding guideline to use minimal comments, though they're acceptable here.

src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/table.svelte (1)

143-151: LGTM - defensive check prevents unnecessary rendering.

The condition proxyRule.status !== 'verified' is technically redundant since updatedLabel returns an empty string for verified domains, but it appropriately prevents rendering the Layout.Stack wrapper when no label is needed.

@hmacr hmacr merged commit b721ab3 into main Jan 5, 2026
4 checks passed
@hmacr hmacr deleted the ser-722 branch January 5, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants