Skip to content

Commit 7f11c5f

Browse files
sametbasbugclaude
andcommitted
Give the human card a style of its own
The "İnsanı" card broke when it stopped being a link. It used to be an anchor to a GitHub profile with `class="human-github-card"`; removing GitHub turned it into a plain div named `human-card`, and every rule stayed behind under the old name. The card printed unstyled — avatar and text piling onto each other — and no test noticed, because the tests looked at the HTML or at the CSS and nothing looked at the join between them. The new rules are not a rename. The old grid declared three columns for avatar, text and an external-link arrow; with the arrow gone, keeping three squeezed the text column and clipped the handle. It is two columns now. Hover lift and the pointer treatment are gone too — there is nowhere to click, and a surface that looks clickable but is not is worse than no link at all. `object-fit: cover` is new: the avatar comes from the provider with no guarantee of being square, and without it a portrait image is squashed inside the round frame rather than cropped. The caption changed with the meaning. "Orbit hesabıyla bağlandı" made sense when the alternative was another provider; now that the account is always an Orbit account it says nothing. It reads "Sponsoru". A lock now holds the two class names in the markup and in the stylesheet together, scoped to this card rather than sweeping every class — a broad sweep would fire whenever a helper class is retired and drown out what this one is saying. Revert-checked: renaming the rules in pages.css fails both assertions with the message that names the consequence. Also drops the GitHub bindings from `scripts/orbit-local-dev.mjs`, which were missed in the removal round and would have demanded two Keychain items that no longer exist. Verified in a browser: rendered through the real `renderAgentProfile` with the real stylesheets, at desktop and 375px, in light and dark. Checked with a portrait avatar as well as none. Local proof: `npm run build` end to end — 227 D1 tests, 2795 site assertions, 557 browser assertions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 1fc9214 commit 7f11c5f

4 files changed

Lines changed: 49 additions & 29 deletions

File tree

‎scripts/orbit-local-dev.mjs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { unstable_dev } from 'wrangler';
33

44
const KEYCHAIN_SERVICE = 'dev.orbit.sametbasbug';
55
const REQUIRED_BINDINGS = [
6-
'GITHUB_OAUTH_CLIENT_ID',
7-
'GITHUB_OAUTH_CLIENT_SECRET',
86
'GOOGLE_OAUTH_CLIENT_ID',
97
'GOOGLE_OAUTH_CLIENT_SECRET',
108
'ORBIT_INVITATION_PEPPER_V1',
@@ -49,8 +47,6 @@ const vars = {
4947
ORBIT_ENVIRONMENT: 'local',
5048
ORBIT_DEPLOYMENT_MODE: 'live',
5149
ORBIT_ALLOWED_ORIGIN: 'http://localhost:4321',
52-
ORBIT_GITHUB_CALLBACK_URL: 'http://localhost:4321/v1/auth/github/callback',
53-
ORBIT_PLATFORM_OWNER_GITHUB_ID: '126420524',
5450
...Object.fromEntries(REQUIRED_BINDINGS.map((name) => [name, readKeychain(name)])),
5551
};
5652
const worker = await unstable_dev('src/worker.ts', {
@@ -67,7 +63,7 @@ const worker = await unstable_dev('src/worker.ts', {
6763
});
6864

6965
process.stdout.write('Orbit V6 local: http://localhost:4321\n');
70-
process.stdout.write('OAuth callback: http://localhost:4321/v1/auth/github/callback\n');
66+
process.stdout.write('OAuth callback: http://localhost:4321/v1/auth/google/callback\n');
7167

7268
for (const signal of ['SIGINT', 'SIGTERM']) {
7369
process.once(signal, async () => {

‎scripts/orbit-site-tests.mjs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,30 @@ check(
730730
'Askıya alma ucu rol kontrolünü kaybetmiş; yetki yalnız tarayıcıda kalmış olur.',
731731
);
732732

733+
/* Worker'ın bastığı sınıfların stil dosyasında karşılığı olmalı.
734+
*
735+
* Bu kilit bir kez ödendi: "İnsanı" kartı GitHub bağlantısıyken `<a
736+
* class="human-github-card">` idi, Google'a geçerken `<div
737+
* class="human-card">` oldu ve CSS eski adın altında kaldı. Kart stilsiz
738+
* bastı — yazılar ve avatar birbirinin üstüne kaydı — ve HİÇBİR test kırıldı.
739+
* Kırılmaması normaldi: testler ya HTML'e ya CSS'e bakıyordu, ikisinin
740+
* arasındaki bağa bakan yoktu.
741+
*
742+
* Kapsam bilerek dar: yalnız bu kart. Bütün sınıfları taramak, tek bir
743+
* yardımcı sınıfı silmenin testi kırmasına yol açar ve o gürültü bu kilidin
744+
* söylediği şeyi boğar. */
745+
const pagesCss = fs.readFileSync(path.join(ROOT, 'src', 'styles', 'pages.css'), 'utf8');
746+
for (const className of ['human-card', 'human-card-placeholder']) {
747+
check(
748+
agentHtml.includes(`class="${className}"`),
749+
`Ajan profili ${className} sınıfını basmıyor; stil ile markup arasındaki bağ kopmuş.`,
750+
);
751+
check(
752+
pagesCss.includes(`.${className}`),
753+
`${className} sınıfının stili yok; kart stilsiz basar ve içeriği birbirine girer.`,
754+
);
755+
}
756+
733757
/* Kayıt kapısı ve posta bütçesi. Bu üç kilit, davet sistemi kalktığında
734758
* sessizce kaybolabilecek şeylere bakıyor — ve kaybolduklarında hiçbir test
735759
* kırmadan kaybolurlar, çünkü yokluklarının belirtisi bir hata değil, fazla

‎src/server/public/agent-html.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function renderHuman(agent: PublicAgentProfileView): string {
134134
<h3>İnsanı</h3>
135135
<div class="human-card">
136136
${avatar}
137-
<span><small>Orbit hesabıyla bağlandı</small><strong>@${escapeHtml(human.handle)}</strong></span>
137+
<span><small>Sponsoru</small><strong>@${escapeHtml(human.handle)}</strong></span>
138138
</div>
139139
</section>`;
140140
}

‎src/styles/pages.css‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -485,66 +485,66 @@
485485
font-size: var(--text-2xs);
486486
}
487487

488-
.human-github-card {
489-
display: grid;
490-
grid-template-columns: auto minmax(0, 1fr) auto;
488+
/* İnsan kartı. Bir zamanlar GitHub profiline giden bir bağlantıydı; artık
489+
* gidilecek bir yer yok, çünkü insanın public sayfası da yok. Bu yüzden
490+
* kart durağan: ne hover, ne imleç değişimi, ne ok işareti. Tıklanabilir
491+
* görünüp tıklanmayan bir yüzey, olmayan bir bağlantıdan daha kötü.
492+
*
493+
* İki sütun: avatar ve yazı. Üçüncü sütun (dış bağlantı oku) kalktığında
494+
* `grid-template-columns` üç değer taşımaya devam ederse yazı kolonu
495+
* daralır ve ad ortadan kesilir — kartın bozuk görünmesinin sebebi buydu. */
496+
.human-card {
497+
display: grid;
498+
grid-template-columns: auto minmax(0, 1fr);
491499
align-items: center;
492-
gap: var(--space-6);
500+
gap: var(--space-5);
493501
margin-top: var(--space-6);
494502
padding: var(--space-5);
495503
border: 1px solid var(--line);
496504
border-radius: 0.8rem;
497505
color: var(--ink);
498506
background: color-mix(in srgb, var(--paper) 58%, var(--surface));
499-
text-decoration: none;
500-
transition: border-color 160ms ease, transform 160ms ease;
501-
}
502-
503-
.human-github-card:hover {
504-
border-color: color-mix(in srgb, var(--agent-accent) 32%, var(--line));
505-
transform: translateY(-1px);
506507
}
507508

508-
.human-github-card img,
509-
.human-github-placeholder {
509+
.human-card img,
510+
.human-card-placeholder {
510511
width: 2.65rem;
511512
height: 2.65rem;
512513
border-radius: 50%;
514+
/* Avatar sağlayıcıdan geliyor ve kare olacağının garantisi yok. `cover`
515+
* olmadan yuvarlak çerçevenin içinde eziliyor. */
516+
object-fit: cover;
513517
background: var(--paper);
514518
}
515519

516-
.human-github-placeholder {
520+
.human-card-placeholder {
517521
display: grid;
518522
place-items: center;
519523
color: var(--muted);
520-
font-size: var(--text-2xs);
524+
font-size: var(--text-xs);
521525
font-weight: var(--weight-black);
526+
line-height: 1;
522527
}
523528

524-
.human-github-card > span:nth-child(2) {
529+
.human-card > span {
525530
display: grid;
526531
min-width: 0;
527532
}
528533

529-
.human-github-card small {
534+
.human-card small {
530535
color: var(--faint);
531536
font-size: var(--text-3xs);
532537
font-weight: var(--weight-bold);
533538
}
534539

535-
.human-github-card strong {
540+
.human-card strong {
536541
overflow: hidden;
537542
margin-top: var(--space-1);
538543
font-size: var(--text-xs);
539544
text-overflow: ellipsis;
540545
white-space: nowrap;
541546
}
542547

543-
.human-github-card > span:last-child {
544-
color: var(--faint);
545-
font-size: var(--text-sm);
546-
}
547-
548548
.profile-project-links {
549549
display: grid;
550550
gap: var(--space-3);

0 commit comments

Comments
 (0)