Skip to content

fix: show Appwrite icon for CLI OAuth consent avatars - #3161

Merged
ChiragAgg5k merged 3 commits into
mainfrom
fix-3159-cli-oauth-logo
Aug 17, 2026
Merged

fix: show Appwrite icon for CLI OAuth consent avatars#3161
ChiragAgg5k merged 3 commits into
mainfrom
fix-3159-cli-oauth-logo

Conversation

@cursor

@cursor cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes the cropped/unreadable Appwrite logo on the CLI OAuth consent and "Device connected" screens (appwrite login --new).

The first-party appwrite-cli client registers a wide wordmark as logoUri. Consent/outcome avatars are square and previously used object-fit: cover, which cropped the wordmark into an unreadable fragment that looked like a missing logo.

Changes:

  • Prefer the square /logos/appwrite-icon.svg mark for appwrite-cli
  • Use object-fit: contain for app logo avatars so other wordmarks stay readable
  • Unit coverage for the logo resolver helper

Test Plan

  • bun run test:unit src/lib/helpers/oauth2-app-logo.test.ts
  • Manually: appwrite login --new and confirm the consent + device-connected screens show the pink Appwrite icon cleanly

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?
Open in WebView Automation

The first-party appwrite-cli client registers a wide wordmark as logoUri.
Consent/outcome avatars use a square crop, so object-fit:cover left an
unreadable fragment that looked like a missing logo (#3159). Prefer the
square mark for that client and contain-fit other logos in the avatar.

Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
@appwrite

appwrite Bot commented Aug 15, 2026

Copy link
Copy Markdown

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

Environment variables can be scoped per function or shared across your project

@cursor
cursor Bot requested a review from ChiragAgg5k August 15, 2026 03:36
@cursor
cursor Bot marked this pull request as ready for review August 15, 2026 03:36
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR updates OAuth consent and outcome avatars to show a square Appwrite icon for the CLI and preserve other application logos without cropping.

  • Adds a shared OAuth application logo resolver.
  • Uses object-fit: contain for application avatars.
  • Adds unit coverage for CLI, third-party, and missing-logo cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/lib/helpers/oauth2-app-logo.ts Adds centralized logo resolution with base-aware Appwrite CLI icon selection and trimmed fallback URLs.
src/lib/helpers/oauth2-app-logo.test.ts Covers first-party icon substitution, preservation of third-party logos, and empty fallback behavior.
src/routes/(public)/oauth2/consent-card.svelte Applies the shared resolver and contain-based image styling to the OAuth consent avatar.
src/routes/(public)/oauth2/outcome-card.svelte Applies the same resolved branding and avatar styling to OAuth outcome screens.

Reviews (3): Last reviewed commit: "Revert "Fix the cropped logo with CSS in..." | Re-trigger Greptile

The avatar used object-fit: cover, which crops a wide wordmark into an
unreadable fragment. Switching to contain fixes that for every client, so
the appwrite-cli special case and its resolver helper are unnecessary.

Hardcoding the CLI's client ID in the console was also the wrong layer:
logoUri is server-owned app-registry data, so a square mark belongs in the
registration upstream. Worse, app IDs are user-supplied, so anyone able to
create an OAuth app on a self-hosted instance could claim `appwrite-cli`
and render official Appwrite branding on a consent screen.

The helper's trim/?? '' normalization was dead too: the {#if} already
covered empty and undefined, and cimdDocumentToApp gates logoUri through
HTTP_URL before it ever reaches the template.

Fold the rule into .avatar rather than a separate img.avatar block. Every
other .avatar is a flex-centered div, so object-fit is inert there and the
padding stays harmless.
@ChiragAgg5k
ChiragAgg5k merged commit 964c9b3 into main Aug 17, 2026
3 of 4 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix-3159-cli-oauth-logo branch August 17, 2026 04:09
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.

CLI OAuth logo is missing

3 participants