Skip to content

Resync tracked values by hand: EditableValue, business bars with Sold/Raided/supplies bought, undo - #26

Merged
ToothyDev merged 5 commits into
mainfrom
claude/4-resync-values
Oct 14, 2026
Merged

ToothyDev merged 5 commits into
mainfrom
claude/4-resync-values

Conversation

@ToothyDev

@ToothyDev ToothyDev commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What this does

Adds the resync building blocks every tracker will use (decision 010):

  • EditableValue (src/components/ui/, logic in src/lib/resync.ts): click a value, type what the game shows, confirm. Units: percent (stock/supplies), money ($120,000, 120k, 1.2m) and time left (h:mm or plain minutes). Trackers pass one-click presets and store the corrected value as of now with their own clock. Undo takes back the last edit and keeps progress counted since.
  • BusinessBars: stock and, where the business has one, supplies, each editable with its meter. Buttons: Full (stock), Sold (empties stock), Raided (a successful police raid empties stock and supplies and cancels supplies on their way; hidden for stock-only businesses) and Supplies bought, which starts a 10-minute delivery with a countdown and fills supplies to 100% when it arrives. One Undo covers the last change to the business, including cancelling a delivery.
  • Game data for these events and the delivery is in src/data/business-events.ts with sources. The delivery wait runs on real time for now; which clock the game uses is not confirmed yet.
  • CLAUDE.md: gta.wiki is a trusted source for game facts.

No business trackers exist yet; they plug these in.

Closes #4

How to check it

npm run dev, open #/kit:

  • Business bars: Raided → both bars 0; Undo → back. Sold → only stock 0. Supplies bought → "Supplies arrive in 0:09:59" counting down, button disabled; after 10 minutes supplies show 100%. Undo before then cancels it; Raided during it cancels it too.
  • Click a value, type 75 → Enter; abc shows what it expects; Escape cancels.
  • Stock only: no supplies bar, no Raided or Supplies bought.
  • Resync: safe takes 120k; set the cooldown to 0:20, wait a minute, Undo lands where the old estimate would be now.

Checklist

  • npm run verify passes
  • Game data added or changed here has a source (see docs/decisions/004-game-data.md)
  • README / CLAUDE.md updated if usage or workflow changed

🤖 Generated with Claude Code

Click a value, type what the game shows (percent, $ or h:mm), confirm. Trackers pass
one-click presets such as Sold or Full and store the value as of now. Undo takes back
the last edit and keeps progress counted since. Decision 010.

Closes #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying lsos with  Cloudflare Pages  Cloudflare Pages

Latest commit: c7df72a
Status: ✅  Deploy successful!
Preview URL: https://47a0aa7e.lsos-2qs.pages.dev
Branch Preview URL: https://claude-4-resync-values.lsos-2qs.pages.dev

View logs

Sold empties stock, a successful police raid empties stock and supplies (sourced in
src/data/business-events.ts). BusinessBars shows stock and optional supplies as
editable values with their meters and a single undo for the business.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToothyDev ToothyDev changed the title Resync tracked values by hand: EditableValue with units, presets and undo Resync tracked values by hand: EditableValue, business bars with Sold/Raided/Full, undo Oct 14, 2026
Replaces Full on the supplies bar. The bars keep the delivery time; settleBars fills
supplies to 100% once it is due. Real time until the game's clock for it is confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToothyDev ToothyDev changed the title Resync tracked values by hand: EditableValue, business bars with Sold/Raided/Full, undo Resync tracked values by hand: EditableValue, business bars with Sold/Raided/supplies bought, undo Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToothyDev
ToothyDev merged commit ecb173f into main Oct 14, 2026
4 checks passed
@ToothyDev
ToothyDev deleted the claude/4-resync-values branch October 14, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core: resync any tracked value by hand

2 participants