Skip to content

fix: show the current icon on the auth result pages - #84

Merged
lmjabreu merged 4 commits into
mainfrom
luis/success-page-icon
Oct 20, 2026
Merged

lmjabreu merged 4 commits into
mainfrom
luis/success-page-icon

Conversation

@lmjabreu

@lmjabreu lmjabreu commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The local "You're connected" and "Authentication failed" pages had their own inline SVG copy of the old icon, so they still showed it after the refresh in #79. They now load LOGO_URI, the PNG the consent screen already shows, so the icon lives in one file.

Doistbot spotted this on the icon docs PR (#83).

It also points LOGO_URI and the README back at icons/comms-cli.png and deletes icons/comms-cli_512px.png, an identical copy left by #79. Clients first registered by 3.6.1 to 3.6.3 sent the _512px URL, so their consent screen will show Todoist's fallback icon.

Test plan

  1. On main, run tdc auth login and approve.
    • The browser page shows the old, washed-out icon.
  2. On this branch, run tdc auth login and approve.
    • The page shows the new icon, with the green check badge.
  3. Repeat with an invalid client or by denying access.
    • The failure page shows the new icon with the red badge.

Demo

BeforeAfter

🤖 Generated with Claude Code

The success and failure pages had their own inline copy of the old
artwork. They now load LOGO_URI, the PNG the consent screen shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lmjabreu lmjabreu added the 👀 Show PR requires passing checks before merge and independent human review before or after merge. label Oct 17, 2026
@lmjabreu

Copy link
Copy Markdown
Contributor Author

@doistbot /review

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This update consolidates the auth icon on the shared LOGO_URI across the local callback pages, replacing the outdated inline SVGs. No inline issues were flagged.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (3)
  • P3 src/lib/auth-constants.ts:7: This comment references docs/icon.md, but no such file exists in the repo (docs/ only has comms-search.md and SPEC.md). Either commit that doc on this branch or drop the parenthetical so the comment doesn't point readers to a dead file.
  • P3 src/lib/auth-pages.ts:4: These pages are the OAuth callback HTML, so their URL can carry the authorization code and state (e.g. http://localhost:8766/callback?code=...&state=...). The new <img> loads https://raw.githubusercontent.com/... without a referrerpolicy, so browsers that still default to no-referrer-when-downgrade will send the full callback URL — including the code — to GitHub in the Referer header. Add referrerpolicy="no-referrer" to this <img> (or a <meta name="referrer" content="no-referrer"> in both page <head>s) so the code never leaves the callback request.
  • P3 src/lib/auth-pages.test.ts:12: The negative assertion checks an incidental Figma group id (Size=72, Style=Color) from the old SVG rather than the observable contract (no inline 72px logo SVG). If a different inline copy ever comes back, this test still passes. Prefer expect(html).not.toMatch(/<svg[^>]*viewBox="0 0 72 72"/) to target the actual 72px logo SVG, or drop the assertion entirely — the toContain('<img src="...') check already fails if the page reverts to the old SVG.

Share Feedback • Review Logs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lmjabreu

Copy link
Copy Markdown
Contributor Author

This comment references docs/icon.md, but no such file exists in the repo

Done. Dropped it, the doc lands in #83.

Add referrerpolicy="no-referrer" to this <img>

Done, with a test. Applied the same to Doist/todoist-cli#601 and Doist/automations#4827.

The negative assertion checks an incidental Figma group id

Done. It now fails on any inline 72px SVG.

@lmjabreu
lmjabreu marked this pull request as ready for review October 17, 2026 17:14
@doistbot
doistbot requested a review from engfragui October 17, 2026 17:14
Comment thread src/lib/auth-pages.ts
import { LOGO_URI } from './auth-constants.js'

// The same PNG the OAuth consent screen shows, so the icon lives in one file.
const COMMS_CLI_ICON = `<img src="${LOGO_URI}" width="72" height="72" alt="" referrerpolicy="no-referrer">`

@engfragui engfragui Oct 19, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💭 The logo now depends on a network fetch from raw.githubusercontent.com. The error page is rendered precisely when auth failed — often due to no/blocked network — so this <img> (with alt="") will show nothing exactly when it's most likely needed. Networks that reach todoist.com but block GitHub raw would also get a broken logo on the success page.

The previous inline SVG rendered unconditionally. Consider keeping an inline SVG / data-URI fallback so the pages always show the icon offline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keeping as-is to avoid one more place the icon needs updating. This page is only reached through the redirect from todoist.com, so the browser is online by then, and inlining the image would only help with performance. If we do inline it, it'd be great to generate it from the PNG automatically, e.g. with a GitHub Action.

Comment thread src/lib/auth-constants.ts Outdated
lmjabreu and others added 2 commits October 19, 2026 23:03
3.6.1 renamed the icon to comms-cli_512px.png while 3.6.0 and earlier
clients still use comms-cli.png, leaving two identical files. Point
LOGO_URI and the README back at comms-cli.png and delete the copy.
Clients registered by 3.6.1 to 3.6.3 will show Todoist's fallback icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lmjabreu
lmjabreu force-pushed the luis/success-page-icon branch from f97e02e to 3289c7d Compare October 19, 2026 22:05
@lmjabreu
lmjabreu merged commit 4800ad6 into main Oct 20, 2026
8 checks passed
@lmjabreu
lmjabreu deleted the luis/success-page-icon branch October 20, 2026 12:03
doist-release-bot Bot added a commit that referenced this pull request Oct 20, 2026
## [3.6.5](v3.6.4...v3.6.5) (2026-10-20)

### Bug Fixes

* show the current icon on the auth result pages ([#84](#84)) ([4800ad6](4800ad6))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.6.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR requires passing checks before merge and independent human review before or after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants