Skip to content

Movable business cards, segmented draggable bars, Owned/Not owned toggle - #34

Merged
ToothyDev merged 9 commits into
mainfrom
claude/31-owned-toggle
Oct 14, 2026
Merged

ToothyDev merged 9 commits into
mainfrom
claude/31-owned-toggle

Conversation

@ToothyDev

@ToothyDev ToothyDev commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What this does

Three UI changes, one per issue:

  • Movable business cards (Movable business trackers #30). On the Businesses tab, a card's title bar is its drag handle. It works like moving apps on a phone: the card lifts and follows the pointer (mouse, pen or touch), and its slot stays outlined. Once the pointer is well inside another card (20% in from each side), the two swap and nothing else moves. Because of that margin, a pointer resting on a border doesn't flick the cards back and forth. On release, the card glides into its slot. With a title bar focused, the arrow keys and Home/End move the card. The order is saved as property ids: state version 5, with a migration from version 4 and a test. Businesses bought later go after the ones you placed. Logic in src/lib/order.ts, Panel gets an optional move prop. Decision 014.
  • Segmented, draggable bars (Business bars: five segments like in game, drag to resync #32). In edit mode, the stock and supplies bars show five segments like in game. Each segment is its own box with a visible edge (--track-edge, 3.4:1 on the panel). Sources: gta.wiki Business Supplies for the MC businesses; the Bunker's segments were seen in play. Collapsed cards keep the plain bar. Each bar is also a slider. A drag rounds to whole percent and snaps to a segment edge from up to 1.5% away. Arrow keys step 1%, Page Up/Down jump to the next segment edge, Home/End go to 0/100%. A run of drags and key steps on one bar is a single Undo. Typing still works for exact values. Decision 010 is updated.
  • Ownership toggle (Settings: ownership as a labelled toggle instead of an "Own …" checkbox #31). Settings → Properties and the Businesses gear show the property name as the row label, with an Owned (filled accent) / Not owned (muted outline) toggle button next to it. The button sets aria-pressed. Decision 011 and #/kit are updated.

Closes #30
Closes #31
Closes #32

How to check it

  • Settings: switch a few businesses between Owned and Not owned. Upgrades appear only when owned.
  • Businesses: drag a card by its title bar onto another card. Only those two trade places, and resting on a border doesn't flicker. Reload; the order stays. Tab to a title bar and press the arrow keys. On a phone, drag a title bar.
  • Businesses → Edit on a card: drag the stock or supplies handle. It snaps near 20/40/60/80%. Try the arrow and Page Up/Down keys on the focused bar, then Undo, which takes back the whole adjustment.
  • #/kit in dev shows the toggle buttons, a segmented meter, and draggable bars and cards.

Checklist

  • npm run verify passes
  • Game data added or changed here has a source (see docs/decisions/004-game-data.md) (BAR_SEGMENTS in src/data/business-events.ts)
  • README / CLAUDE.md updated if usage or workflow changed (CLAUDE.md map line for decision 014)

🤖 Generated with Claude Code

…roperty name

Replaces the "Own <name>" checkbox in Settings and the Businesses gear.
The button uses aria-pressed, filled accent when owned, muted outline when not.

Closes #31

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: 8bfbd26
Status: ✅  Deploy successful!
Preview URL: https://b2d86dad.lsos-2qs.pages.dev
Branch Preview URL: https://claude-31-owned-toggle.lsos-2qs.pages.dev

View logs

Meters show five segments (gta.wiki, Business Supplies; Bunker seen in play).
In the resync controls each bar is a slider: drag snaps to whole percent and
segment edges, arrows/Page keys/Home/End step it, and a run of slider changes
on one bar is one Undo. Typing stays for exact values.

Closes #32

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…keep a plain bar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The order is saved as property ids (state version 5, with a migration from
version 4). Pointer events cover mouse and touch; a focused title bar moves
its card with the arrow keys and Home/End.

Closes #30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToothyDev ToothyDev changed the title Settings: ownership as an Owned/Not owned toggle next to the property name Movable business cards, segmented draggable bars, Owned/Not owned toggle Oct 14, 2026
Empty segments had too little contrast against the panel. Each segment is now its
own box, a little taller, with a --track-edge outline at 3.4:1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…under it

Moving a card no longer shifts every card in between along the rows. The lifted
card sticks to the pointer, its slot stays outlined, only the card it lands on
moves, and it glides into place on release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pointer resting on the border between two cards flicked them back and forth.
A swap now needs the pointer 20% inside the target, measured on the layout so
cards still sliding do not count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToothyDev
ToothyDev merged commit c20e165 into main Oct 14, 2026
4 checks passed
@ToothyDev
ToothyDev deleted the claude/31-owned-toggle branch October 14, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants