Files
accounted/components/dashboard/MainContainer.tsx
T
Jakob WennbergandClaude Sonnet 5 ec27228a8e style: remove em/en dashes repo-wide, add CLAUDE.md rule against them (#890)
Em dashes (—) and en dashes (–) had spread across comments, docs, tests,
and a few UI strings, reading as AI-generated boilerplate rather than
house style. Replaced each with punctuation matching its context: colon
for explanatory clauses, comma for asides, plain hyphen for numeric/legal
ranges (e.g. "21-23§"), "to"/"till" for date ranges, parentheses for
paired-dash asides. messages/en.json and messages/sv.json were fixed by
hand together to keep sv/en in sync.

Left untouched where the dash is the functional subject rather than
decorative punctuation: date-range-parser.ts's separator regex,
charset-repair.ts's CP1252 byte-mapping table (and its test), the SIE
encoding mojibake docs, generic-csv.ts's minus-sign normalizer, the
agent system-prompt files that already instruct against em dashes, and
a golden iXBRL test fixture compared byte-for-byte.

Also fixes two bugs surfaced along the way: an off-by-one in
ApiKeysPanel's scope-label split (a leftover from an earlier partial
pass), and a charset-repair test that had lost the literal en-dash it
exists to verify.

Regenerated the agent atom seed migration (skills:generate) since 27
SKILL.md files changed. Added a CLAUDE.md rule against em/en dashes,
with an explicit carve-out for the functional-dash cases above.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 15:58:06 +02:00

42 lines
1.3 KiB
TypeScript

'use client'
import { usePathname } from 'next/navigation'
import type { ReactNode } from 'react'
/**
* Picks the dashboard chrome container based on route. Extension workspaces
* (/e/*) and the /chat app shell want the full viewport for their own
* multi-pane layouts; everything else gets the centered max-w-5xl card.
*
* Lives in a client component because the parent (dashboard) layout is
* shared across all dashboard routes. Server-side pathname checks done in
* the layout don't re-evaluate reliably on soft navigation between sibling
* routes, so the wrapper class would otherwise stick on whichever branch
* the first render picked.
*/
export function MainContainer({
companyId,
children,
}: {
companyId: string | null
children: ReactNode
}) {
const pathname = usePathname()
// Full-bleed routes own their own padding + multi-pane layout. They
// shouldn't sit inside max-w-5xl or any horizontal padding: that's what
// causes a visible gap between the dashboard sidebar and the chat-sidebar
// pane on wide viewports.
const isFullBleed = pathname.startsWith('/e/') || pathname.startsWith('/chat')
return isFullBleed ? (
<div key={companyId ?? ''} className="h-full">{children}</div>
) : (
<div
key={companyId ?? ''}
className="max-w-5xl mx-auto px-5 py-8 md:px-8 md:py-10"
>
{children}
</div>
)
}