Skip to content
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
58 changes: 29 additions & 29 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ Svelte 5 + TypeScript + Vite. Public repository.

## Where things are

| Need | Look in |
| ---------------------------------------------- | ------------------------------------------------- |
| Why something is built the way it is | `docs/decisions/README.md` (index, then one file) |
| What to work on | the issue the maintainer names, only that issue |
| Continue an unfinished PR | `docs/handoff/<file>.md` on the PR branch |
| Tabs and hash routing | `src/lib/tabs.ts`, `src/App.svelte` |
| Play/real clocks, `onPlayTime` for trackers | `src/lib/clock.ts`, `clock.svelte.ts` (dec. 008) |
| Game logic (pure TS, unit-tested) | `src/lib/` |
| Saved user state, migrations, export/import | `src/lib/state.ts`, `src/lib/store.svelte.ts` |
| UI components (thin) | `src/components/` |
| Base UI kit (panel, meter, button...), preview | `src/components/ui/`, `#/kit` in dev (dec. 009) |
| Resync values, editable bars (dec. 010, 018) | `ui/EditableValue`, `EditableBar`, `BusinessBars` |
| Game data with sources | `src/data/` (decision 004) |
| Owned properties and upgrades | `data/properties.ts`, `lib/properties.ts` (011) |
| Business production (stock, supplies, value) | `data/production.ts`, `lib/production.ts` (012) |
| Nightclub warehouse goods | `data/nightclub.ts`, `lib/nightclub.ts` (015) |
| Business card order (drag, keys) | `lib/order.ts`, `ui/Panel` `move` (decision 014) |
| Safes and nightclub popularity | `data/safes.ts`, `lib/safes.ts` (decision 016) |
| Acid Lab, production boost | `data/production.ts`, `lib/production.ts` (017) |
| Money Fronts safe and heat | `data/fronts.ts`, `lib/fronts.ts` (018) |
| Value bonus for owning a front | `ownedBonus` in `data/production.ts` (019) |
| Shut-down businesses (owned, not running) | `isRunning` in `lib/properties.ts` (020) |
| Bunker staff on manufacturing/both/research | `staffSplit` in `data/production.ts` (025) |
| Real-time timers: Lucky Wheel, Mansion boost | `data/timers.ts`, `lib/timers.ts` (022) |
| Overview tab, next events, notifications | `lib/events.ts`, `lib/overview.ts` (dec. 023) |
| Theme tokens | `src/app.css` (decision 009) |
| Link previews (Open Graph), preview image | `index.html`, `scripts/og-image.html` |
| CI, templates | `.github/` |
| Skills: `handoff`, `finish-pr`; agent: `scout` | `.claude/` |
| Need | Look in |
| ---------------------------------------------- | -------------------------------------------------- |
| Why something is built the way it is | `docs/decisions/README.md` (index, then one file) |
| What to work on | the issue the maintainer names, only that issue |
| Continue an unfinished PR | `docs/handoff/<file>.md` on the PR branch |
| Tabs and hash routing | `src/lib/tabs.ts`, `src/App.svelte` |
| Play/real clocks, `onPlayTime` for trackers | `src/lib/clock.ts`, `clock.svelte.ts` (dec. 008) |
| Game logic (pure TS, unit-tested) | `src/lib/` |
| Saved user state, migrations, export/import | `src/lib/state.ts`, `src/lib/store.svelte.ts` |
| UI components (thin) | `src/components/` |
| Base UI kit (panel, meter, button...), preview | `src/components/ui/`, `#/kit` in dev (dec. 009) |
| Resync values, editable bars (dec. 010, 018) | `ui/EditableValue`, `EditableBar`, `BusinessBars` |
| Game data with sources | `src/data/` (decision 004) |
| Owned properties and upgrades | `data/properties.ts`, `lib/properties.ts` (011) |
| Business production (stock, supplies, value) | `data/production.ts`, `lib/production.ts` (012) |
| Nightclub warehouse goods | `data/nightclub.ts`, `lib/nightclub.ts` (015) |
| Card order (drag, keys) on every card tab | `lib/order.ts`, `ui/CardGrid` (decisions 014, 026) |
| Safes and nightclub popularity | `data/safes.ts`, `lib/safes.ts` (decision 016) |
| Acid Lab, production boost | `data/production.ts`, `lib/production.ts` (017) |
| Money Fronts safe and heat | `data/fronts.ts`, `lib/fronts.ts` (018) |
| Value bonus for owning a front | `ownedBonus` in `data/production.ts` (019) |
| Shut-down businesses (owned, not running) | `isRunning` in `lib/properties.ts` (020) |
| Bunker staff on manufacturing/both/research | `staffSplit` in `data/production.ts` (025) |
| Real-time timers: Lucky Wheel, Mansion boost | `data/timers.ts`, `lib/timers.ts` (022) |
| Overview tab, next events, notifications | `lib/events.ts`, `lib/overview.ts` (dec. 023) |
| Theme tokens | `src/app.css` (decision 009) |
| Link previews (Open Graph), preview image | `index.html`, `scripts/og-image.html` |
| CI, templates | `.github/` |
| Skills: `handoff`, `finish-pr`; agent: `scout` | `.claude/` |

## Commands

Expand Down
3 changes: 2 additions & 1 deletion docs/decisions/014-card-order.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 014: Business cards in the user's order

2026-10-14, issue #30. Builds on decisions 006 and 009.
2026-10-14, issue #30. Builds on decisions 006 and 009. Extended to other tabs, with easier
grabbing and swapping, by decision 026.

## Decision

Expand Down
27 changes: 27 additions & 0 deletions docs/decisions/026-movable-cards-everywhere.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 026: Movable cards on every card tab, easier to swap

2026-10-15, issue #51. Builds on decision 014.

## Decision

- **Shared grid.** The drag and keyboard moving of decision 014 lives in `ui/CardGrid`, which
renders each card through a snippet and hands it the title bar handlers (`Panel`'s `move`).
Businesses, Safes (Money Fronts and the property safes) and Timers use it. Settings stays
fixed (its panels are not cards to compare), and the Overview is lists, not cards.
- **Title bar only.** A card is picked up by its title bar, with mouse, pen and touch alike;
the rest of the card keeps its text selectable and its controls undisturbed (issue #51
review: grabbing anywhere got in the way of both). It lifts only after 4 px of travel, so a
click on the title bar stays a click.
- **Swap by where the card is.** A swap is decided by the middle of the dragged card, not the
pointer: held by its title bar, a card hangs far below the pointer, so the pointer often sat
on a border while the card already covered its target. The middle must be 10% in from each
side of the other card (was 20%), which still leaves a band where neither swap applies, so
the cards do not flick back and forth.
- **Saved state** (version 13): `safeOrder` and `timerOrder`, lists of card ids like
`businessOrder`. Safe cards use property ids (the car wash for Money Fronts), timer cards
`lucky-wheel` and `mansion`, the same ids the Overview links scroll to.

## Why

Issue #51: only business cards moved, and they were hard to swap.
One grid component keeps the three tabs behaving alike; it came from three real cases.
1 change: 1 addition & 0 deletions docs/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ free number, add one line below. **Replacing one:** write a new decision, then m
- [023](023-overview.md) Overview tab: trackers give a shared `NextEvent`, due first then soonest, supplies on their way counted in the forecast, links that scroll to the card, quick actions with undo on every ready item, popularity in view; alerts as pop-ups and/or notifications, set time ahead
- [024](024-several-tabs.md) Several tabs: a tab takes the state another tab saves (`storage` event); only the tab that last started counting counts play time (`BroadcastChannel`)
- [025](025-bunker-staff.md) Bunker staff on Manufacturing, Both or Research: a stock share (Both 0.5, Research 0) on the sourced rates, supplies used as fast on every option (est.), research progress not tracked
- [026](026-movable-cards-everywhere.md) Movable cards on Businesses, Safes and Timers (`ui/CardGrid`): picked up by the title bar; swap by the dragged card's middle, 10% in; orders saved per tab
4 changes: 4 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
onchange={setProperties}
stored={store.state.safes}
onresync={(id, safe) => (store.state.safes = { ...store.state.safes, [id]: safe })}
order={store.state.safeOrder}
onorder={(order) => (store.state.safeOrder = order)}
/>
{:else if active === 'timers'}
<Timers
Expand All @@ -120,6 +122,8 @@
timers={store.state.timers}
now={clocks.now}
onchange={(timers) => (store.state.timers = timers)}
order={store.state.timerOrder}
onorder={(order) => (store.state.timerOrder = order)}
/>
{:else if active === 'settings'}
<Settings />
Expand Down
Loading
Loading