Skip to content

Conversation

HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Sep 25, 2025

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

image

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

yes

Summary by CodeRabbit

  • New Features

    • Added a “Create API key” card to onboarding with immediate copy actions for new keys and endpoints.
    • New API endpoint display added and exposed for use in headers and key views.
    • Project ID can be copied directly from the header; key-creation success offers “Copy API key” and “Copy endpoint”.
  • Style

    • Updated onboarding visuals with new imagery and right-arrow icon.
    • Improved card layout and responsive stacking for small viewports.
    • Tooltip sizing adjusted for copy actions; endpoint/tag visuals refined.

Copy link

appwrite bot commented Sep 25, 2025

Console

Project ID: 688b7bf400350cbd60e9

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

Note

Cursor pagination performs better than offset pagination when loading further pages.

Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Replaces the onboarding “Or connect” block with a Create API key card using new image assets (PlatformSdkImgSource / PlatformSdkImgSourceDark) and a new .api-key-card-image style; updates responsive stacking to respect isSmallViewport. Adds a new ApiEndpoint component and re-exports it from the components index. Extends the Id component with an optional copyText prop. Changes createKey to return { $id, secret } and adds notification actions to copy the secret and endpoint. Header views now show copy-wrapped secrets and render the region API endpoint. Minor presentational and import/export adjustments across overview and API-keys views.

Suggested reviewers

  • ItzNotABug
  • TorstenDittmann

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely conveys the primary change of adding a new onboarding card to surface API key creation and visibility, matching the main content adjustment in the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-SER-393-api-key-visibility-onboarding

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 910625d and 7b0cad0.

📒 Files selected for processing (1)
  • src/lib/components/regionEndpoint.svelte (2 hunks)
⏰ 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 (3)
src/lib/components/regionEndpoint.svelte (3)

4-5: LGTM!

The import additions for Icon, Tag, and IconDuplicate align well with the new component structure.


42-47: LGTM!

The region flag styling is appropriate, with reasonable dimensions (16×12px), subtle border radius, and proper spacing.


24-32: Verify Copy component prop, simplify optional chaining, add i18n.

  • Confirm that the Copy component supports a copyText prop (it wasn’t found in the codebase search).
  • Change alt={region?.name} to alt={region.name} since you’re already inside {#if region}.
  • Replace the hardcoded “API endpoint” label with the project’s i18n translation.

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.

- Show copy buttons in API key creation notification
- Replace regional endpoint references with API endpoint
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b81865e and 8f0376e.

📒 Files selected for processing (6)
  • src/lib/components/apiEndpoint.svelte (1 hunks)
  • src/lib/components/id.svelte (1 hunks)
  • src/lib/components/index.ts (1 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/(components)/create.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/api-keys/[key]/header.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/header.svelte (2 hunks)
⏰ 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 (5)
src/lib/components/id.svelte (1)

56-61: Prop extension looks correct.

Thanks for threading the new copyText prop through to <Copy>. This keeps the Id component flexible without breaking existing call sites.

src/lib/components/index.ts (1)

85-86: Good addition.

Exporting ApiEndpoint from the barrel keeps the public surface consistent with the rest of the components.

src/lib/components/apiEndpoint.svelte (1)

8-15: LGTM.

Wrapping the endpoint in the shared <Copy> + <Tag> treatment keeps the UI aligned with the other copy affordances.

src/routes/(console)/project-[region]-[project]/overview/(components)/create.svelte (1)

47-59: Nice UX touch.

Including clipboard actions right in the success toast is a great improvement.

src/routes/(console)/project-[region]-[project]/overview/header.svelte (1)

31-33: Copy affordance fits well.

Passing copyText through to <Id> and reusing the new ApiEndpoint keeps the header consistent with the API key view.

HarshMN2345 and others added 3 commits September 26, 2025 11:57
…eys/[key]/header.svelte

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 1

🧹 Nitpick comments (3)
src/routes/(console)/project-[region]-[project]/overview/header.svelte (1)

34-48: Consider extracting inline styles to CSS classes.

Multiple inline styles are applied to the image and text span. Extracting these to CSS classes would improve maintainability and readability.

Example refactor:

{#if $projectRegion?.flag}
    <Tag size="xs" variant="code">
        <img
            src={getFlagUrl($projectRegion.flag)}
            alt={$projectRegion.name}
            slot="start"
            class="region-flag" />
        <span class="region-name">
            {$projectRegion.name}
        </span>
    </Tag>
{/if}

Add to the <style> section:

.region-flag {
    width: 16px;
    height: 12px;
}

.region-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
src/routes/(console)/project-[region]-[project]/overview/onboard.svelte (2)

29-30: Consider using consistent image formats.

The light theme image uses .jpg while the dark theme uses .png. For consistency and potentially better optimization, consider converting both to the same format (preferably .png for transparency support or .webp for better compression).


702-719: Consider text readability on smaller screens.

The background-position: right center combined with content positioned at flex-end (bottom) works well for larger screens. However, verify that the background image doesn't obscure the text on smaller viewports or when the card width is constrained.

The overall CSS structure is solid, using consistent design tokens and responsive breakpoints.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea9de05 and ba5ab1a.

⛔ Files ignored due to path filters (1)
  • src/routes/(console)/project-[region]-[project]/overview/assets/platform-sdk-dark.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • src/routes/(console)/project-[region]-[project]/overview/api-keys/[key]/header.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/header.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/onboard.svelte (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/(console)/project-[region]-[project]/overview/api-keys/[key]/header.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 (7)
src/routes/(console)/project-[region]-[project]/overview/header.svelte (3)

3-3: LGTM!

The new imports (ApiEndpoint, Tag, and getFlagUrl) are all properly utilized in the component.

Also applies to: 9-9, 13-13


32-32: LGTM!

The copyText prop enhances the user experience by providing clear copy action feedback.


33-33: LGTM!

The ApiEndpoint component is correctly integrated into the header layout.

src/routes/(console)/project-[region]-[project]/overview/onboard.svelte (4)

17-17: LGTM!

The import simplification correctly removes unused icon imports while retaining IconArrowRight, which is used throughout the component.


102-104: LGTM!

The explicit responsive direction prop is consistent with the layout pattern used throughout the component and ensures proper stacking on small viewports.


344-369: Verify the card padding choice.

This card uses padding="none" while other platform cards use padding="s". This appears intentional since the background image needs to fill the entire card, but please confirm this is the desired design.

The overall implementation is well-structured with proper theme-aware image handling and analytics tracking.


342-342: CSS classes confirmedwith-separators is defined in src/routes/+layout.svelte and eyebrow-heading-3 is part of the global design system.

…r.svelte

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@HarshMN2345 HarshMN2345 self-assigned this Oct 2, 2025
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: 1

🧹 Nitpick comments (2)
src/lib/components/copy.svelte (1)

60-60: Consider making maxWidth configurable.

The hardcoded maxWidth="500px" limits flexibility for different tooltip content lengths across various use cases. While acceptable given the TODO comment on line 53 suggesting this component's removal, consider exposing maxWidth as an optional prop if this component will remain in use longer than anticipated.

src/lib/components/regionEndpoint.svelte (1)

24-32: Minor: Redundant optional chaining.

The optional chaining region?.name on line 29 is unnecessary since it's already inside the {#if region} block which ensures region is truthy. While harmless, simplifying to region.name improves clarity.

Apply this diff to remove redundant optional chaining:

-                <img class="region-flag" src={flagSrc} alt={region?.name} />
+                <img class="region-flag" src={flagSrc} alt={region.name} />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c716e4 and 910625d.

📒 Files selected for processing (4)
  • src/lib/components/copy.svelte (1 hunks)
  • src/lib/components/regionEndpoint.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/api-keys/[key]/header.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/overview/header.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/routes/(console)/project-[region]-[project]/overview/api-keys/[key]/header.svelte
  • src/routes/(console)/project-[region]-[project]/overview/header.svelte
🔇 Additional comments (1)
src/lib/components/regionEndpoint.svelte (1)

4-5: LGTM!

The new imports align with the refactored UI components used in the markup.

Comment on lines +35 to +40
<style>
.endpoint-label {
white-space: nowrap;
overflow: hidden;
word-break: break-all;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Fix CSS inconsistencies for better text overflow handling.

The .endpoint-label styles have two issues:

  1. word-break: break-all has no effect because white-space: nowrap prevents line breaking entirely.
  2. Missing text-overflow: ellipsis means truncated text will be cut off without visual indication (no "..." shown).

Apply this diff to improve text overflow handling:

 .endpoint-label {
     white-space: nowrap;
     overflow: hidden;
-    word-break: break-all;
+    text-overflow: ellipsis;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<style>
.endpoint-label {
white-space: nowrap;
overflow: hidden;
word-break: break-all;
}
<style>
.endpoint-label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
🤖 Prompt for AI Agents
In src/lib/components/regionEndpoint.svelte around lines 35–40, update the
.endpoint-label CSS so text truncation works correctly: remove the ineffective
word-break: break-all; keep white-space: nowrap and overflow: hidden, add
text-overflow: ellipsis, and ensure the element has a display that supports
ellipsis (e.g. display: block or display: inline-block). This will produce the
"..." when the text is truncated and avoid contradictory rules.

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.

1 participant