8000 fix(ui): tune typography independently by area by simon-inkie · Pull Request #145 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content
8000
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .specs/deck-typography-px-port-SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Tune typography by text area

Status: typography implemented; focused checks, browser checks, build and compiler pass. Full workspace and all-ref privacy gates remain failed; clean candidate verification is pending.
Base: current OSS main.

## Problem and result

Make chat, navigation, decision cards, composer and document review text sizes adjustable by area, with distinct review heading levels. The final reusable text tuning is absent from OSS main. Composer control geometry is a separate change.

## Scope and donor selection

Compare individual committed patches and current source, never import the private branch history or whole component files. The bounded donor set for this review unit contains five typography changes. Exact comparison evidence remains in the private review packet. Consolidate their final behaviour without carrying intermediate overrides or history-only comments.

Expected surfaces are app.css, Compose, DecisionCard, Sidebar, MessageBubble and ReviewPanel, with focused component verification. Preserve current OSS behaviour outside typography, including existing paste, microphone, upload, draft and decision behaviour. Add no dependencies, settings, process runner, provider, authentication or migration changes. Do not rebuild or repoint any running service or owned checkout.

Use final donor values only where missing: chat 1.0625rem/1.45 line height, review 0.875rem with h2 1.25em/h3 1em, navigation 0.9375rem, decision cards 1rem/1.5, composer 0.9375rem with 3.25rem minimum height. Review Tailwind merging and cascade, including small root sizes.

## Acceptance and gates

1. Record both donor ancestry/patch equivalence in the development branch and current OSS source. Skip already implemented changes. Keep unrelated source bytes and functionality intact.
2. Focused real component verification retains upload/voice/draft behaviour and checks typography hooks and cascade.
3. Verify computed text sizes, leading, composer height and review heading sizes at small, default and large root font sizes if a real browser is available. Otherwise report browser proof NOT RUN; class assertions alone are not rendered acceptance.
4. Run required repository checks appropriate to source changes: focused and workspace tests, build, one final authoritative typecheck, boundaries, leak self-test/full scan, licence, package versions and ASCII. Never overlap authoritative compilers. Preserve actual failures and synthetic/native limitations.
5. Freeze exact source and receipts. Main reviews and signs the selected commit, then normal branch push and PR with exact validation. Peer review and actual code-review verdict are required; maintainer merge and deployment remain separate gates.

## Work log

2026-11-17: SPEC written before source implementation on a fresh branch from OSS main. Typography and pixel sizing are the priority. Source audit, builder allocation and final gates pending.

### Review unit qualification

The five typography changes form this branch's first logical PR. Only typography tokens and their six component/style surfaces belong here. The two composer pixel sizing/clearance changes have a separate main-based PR and SPEC; its source and test do not belong in this branch. Independent review notes must explain each constituent change and state whether it is generic and suitable for OSS. Both changesets already exist in the development source branch; this work only ports the missing reusable parts to OSS.

### 2026-11-17: Implementation pickup
Current main lacks the selected typography tokens and hooks. Port only the final text tuning across six surfaces; composer control geometry stays in its separate review unit. Existing public prose and motion styles use the mc convention, which the new hooks retain. No root font-size environment setting exists in current main. Generic CSS tokens are suitable for OSS; no installation-specific setting is included. Source and verification remain pending.

The existing Sidebar has no narrator row. Only its agent-name hook is ported; adding unrelated navigation UI is excluded. The final composer text hook removes conflicting min-height, top-padding and font-size utilities, while leaving its existing rem control reserve unchanged.

### 2026-11-17: Verification result
The five constituent behaviours are typography controls for leading/height/navigation/cards, independent text sizes for chat and review, a larger composer, final chat size/leading, and distinct review heading sizes. These are reusable OSS CSS behaviours; no installation-specific material is required. Browser checks rendered the actual components with candidate build CSS and local data/media doubles at root sizes 12px, 16px and 24px. Text sizes, paragraph leading, review h2/h3 sizes and composer minimum height/top padding matched the selected values. This is computed-browser proof, not native installation or full application E2E proof.

Focused checks passed (39 tests plus 56 surface tests), build and authoritative workspace compiler passed. The workspace run passed 85 base tests and 2263 Deck tests, skipped 11 and failed 74 Deck tests. Failures include clean-tree assertions on the required unstaged changes and read-only home fixture creation. Boundaries, working-tree privacy, leak self-test, licence, library version and dash checks passed. All-ref history and message scans failed with 345 and 69 findings. Those failures are retained; a fresh clean candidate and scoped history review remain required before release. Touched files are ASCII; existing unrelated non-ASCII text is unchanged. No commit, external review or publication is part of this implementation receipt.
52 changes: 51 additions & 1 deletion packages/deck/app/app.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
@import "tailwindcss";

/* Per-area typography tokens; rem sizes follow the root font size. */
:root {
--mc-chat-font-size: 1.0625rem;
--mc-chat-leading: 1.45;
--mc-review-pane-font-size: 0.875rem;
--mc-review-h2-font-size: 1.25em;
--mc-review-h3-font-size: 1em;
--mc-nav-font-size: 0.9375rem;
--mc-decision-card-font-size: 1rem;
--mc-decision-card-leading: 1.5;
--mc-composer-font-size: 0.9375rem;
--mc-composer-min-height: 3.25rem;
--mc-composer-padding-top: 0.55rem;
}

/*
* Inkie Deck theme - the canonical Inkie design language (retro2, teal-led).
* The custom properties below are the source of truth for it: there is no
Expand Down Expand Up @@ -130,7 +145,7 @@
}
.prose-mc p {
margin: 0.5em 0;
line-height: 1.6;
line-height: var(--mc-chat-leading);
}
.prose-mc ul,
.prose-mc ol {
Expand Down Expand Up @@ -368,6 +383,41 @@
}
}

.mc-composer-textarea {
min-height: var(--mc-composer-min-height);
padding-top: var(--mc-composer-padding-top);
font-size: var(--mc-composer-font-size);
}

.mc-chat-message-copy {
font-size: var(--mc-chat-font-size);
}

.mc-review-pane-copy {
font-size: var(--mc-review-pane-font-size);
}

.mc-review-pane-copy.prose-mc h2 {
font-size: var(--mc-review-h2-font-size);
}

.mc-review-pane-copy.prose-mc h3 {
font-size: var(--mc-review-h3-font-size);
}

.mc-sidebar-agent-name {
font-size: var(--mc-nav-font-size);
}

.mc-decision-card-copy {
font-size: var(--mc-decision-card-font-size);
line-height: var(--mc-decision-card-leading);
}

.mc-decision-card-copy.prose-mc p {
line-height: var(--mc-decision-card-leading);
}

@keyframes mc-pop-in {
from {
opacity: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/deck/app/components/Compose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ export function Compose({
}
>
>
className="min-h-10 max-h-[40vh] w-full resize-none overflow-y-auto rounded-md border border-input bg-background px-3 py-2 pr-[5rem] pb-10 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background disabled:opacity-50"
className="mc-composer-textarea max-h-[40vh] w-full resize-none overflow-y-auto rounded-md border border-input bg-background px-3 pr-[5rem] pb-10 text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background disabled:opacity-50"
/>

{/* Attach + Mic live inside the textarea border, bottom-right corner */}
Expand Down
6 changes: 3 additions & 3 deletions packages/deck/app/components/DecisionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export function DecisionCard({ block, now, onWriteOwn, draftCustomAnswer, onOpen
setExpanded(true);
}}
>
<div className="prose-mc line-clamp-2 text-sm text-foreground/70">
<div className="mc-decision-card-copy prose-mc line-clamp-2 text-foreground/70">
<Markdown >
</div>
<span className="mt-1 flex items-center justify-end gap-0.5 label-mono text-[10px] text-muted-foreground">
Expand All @@ -214,7 +214,7 @@ export function DecisionCard({ block, now, onWriteOwn, draftCustomAnswer, onOpen
) : (
<div className="p-4">
{block.body ? (
<div className="prose-mc mb-4 text-sm text-foreground/80">
<div className="mc-decision-card-copy prose-mc mb-4 text-foreground/80">
<Markdown >
</div>
) : null}
Expand Down Expand Up @@ -304,7 +304,7 @@ export function DecisionCard({ block, now, onWriteOwn, draftCustomAnswer, onOpen

{/* Card body (agent-authored, sanitized via Markdown) */}
{block.body ? (
<div className="prose-mc mb-4 text-sm text-foreground/80">
<div className="mc-decision-card-copy prose-mc mb-4 text-foreground/80">
<Markdown >
</div>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion packages/deck/app/components/MessageBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export function MessageBubble({ own, block, now, onOpenDoc, threadAgent, superse
</Badge>
) : null}
</div>
<div className={`prose-mc max-w-prose px-4 py-2.5 ${bubbleClass}`}>
<div className={`mc-chat-message-copy prose-mc max-w-prose px-4 py-2.5 ${bubbleClass}`}>
<Markdown >
</div>
<div className="mt-1 flex items-center gap-1 px-1">
Expand Down
2 changes: 1 addition & 1 deletion packages/deck/app/components/ReviewPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function PanelContentImpl({ docParam, onClose, onOpenDoc }: PanelContentProps) {
</div>
)
: (
<div className="prose-mc text-sm">
<div className="mc-review-pane-copy prose-mc">
<Markdown
>
reviewDocBasePath={basePath}
Expand Down
2 changes: 1 addition & 1 deletion packages/deck/app/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function Sidebar({ agents }: { agents: SidebarAgent[] }) {
let a long name give way, `shrink-0` keeps the dots and
the pill their own size w 5CE7 hatever the name does. */}
<span className="flex min-w-0 items-center gap-1.5">
<span className="truncate font-display text-sm font-bold uppercase tracking-tight text-foreground">
<span className="mc-sidebar-agent-name truncate font-display font-bold uppercase tracking-tight text-foreground">
{a.name}
</span>
{a.hasUnread ? (
Expand Down
Loading
0