Skip to content

Commit e772b04

Browse files
Emphasize atproto handle (@ + larger font) (v0.4.4) (#109)
* Emphasize the atproto handle in the credentials list (@ + larger font) Show the handle as "@handle" in a larger, bold font so it stands out, with the DID de-emphasized in parentheses. Applied to both the server (ssr.ts) and client (profile.html) renderers; integration assertions updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Release v0.4.4 --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 68daa0f commit e772b04

5 files changed

Lines changed: 14 additions & 8 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@startup-api/cloudflare",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"license": "Apache-2.0",
55
"publishConfig": {
66
"access": "public"

public/users/profile.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ <h3>Link another account</h3>
451451
}
452452
function credentialIdentifier(c) {
453453
if (c.provider === 'atproto') {
454-
return c.handle ? `${c.handle} (${c.subject_id})` : c.subject_id;
454+
if (!c.handle) return c.subject_id;
455+
return `<span style="font-size: 1.05rem; font-weight: 600;">@${c.handle}</span> <span style="opacity: 0.6;">(${c.subject_id})</span>`;
455456
}
456457
return c.email || c.subject_id;
457458
}

src/handlers/ssr.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,14 @@ function providerLabel(provider: string): string {
214214
return provider.charAt(0).toUpperCase() + provider.slice(1);
215215
}
216216

217-
/** The identifier shown under the provider name. atproto shows the handle with the DID in parens. */
217+
/**
218+
* The identifier shown under the provider name. atproto emphasizes the handle (larger, with an `@`)
219+
* and de-emphasizes the DID in parentheses.
220+
*/
218221
function credentialIdentifier(c: any): string {
219222
if (c.provider === 'atproto') {
220-
return c.handle ? `${c.handle} (${c.subject_id})` : c.subject_id;
223+
if (!c.handle) return c.subject_id;
224+
return `<span style="font-size: 1.05rem; font-weight: 600;">@${c.handle}</span> <span style="opacity: 0.6;">(${c.subject_id})</span>`;
221225
}
222226
return c.email || c.subject_id;
223227
}

test/integration.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,10 @@ describe('Integration Tests', () => {
344344
expect(html).toContain('twitch@example.com');
345345
expect(html).toContain('providers="google,twitch,patreon"');
346346
expect(html).not.toContain('{{ssr:profile_name}}');
347-
// atproto credential: branded label + "handle (did)" identifier, not the bare provider key.
347+
// atproto credential: branded label + "@handle (did)" identifier, not the bare provider key.
348348
expect(html).toContain('Atmosphere / ATproto');
349-
expect(html).toContain('tester.bsky.social (did:plc:abc123)');
349+
expect(html).toContain('@tester.bsky.social');
350+
expect(html).toContain('(did:plc:abc123)');
350351
// The old Bluesky butterfly mark must not appear anywhere on the rendered page (SSR or client script).
351352
expect(html).not.toContain('M12 10.5C10.9');
352353
});

0 commit comments

Comments
 (0)