Repository navigation
Saved gear: named rifle, optic and ammo load profiles - #6
Merged
Merged
Conversation
Named profiles stored in localStorage (bc-gear-v1) with a picker per kind, Save / Save as / Delete, and a 'modified' indicator. Loading a profile writes its fields and toggles back and recalculates. Stored data is sanitised on load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM
The load profile now holds just bullet weight, muzzle velocity and BC (with its G1/G7 model) under a free-text name. Caliber moves to the rifle profile and the form's Rifle section. Bullet weight gets a gr/g toggle that converts in place; the solver always works in grains internally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM
…h the load The caliber field becomes a picker of common cartridges (.17 HMR to .50 BMG), each mapped to its real bullet diameter, which is written to the mm field the solver reads. 'Custom diameter' reveals that field for anything else. The choice is saved with the rifle profile. Bullet length is now part of the load profile and may be left empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM
Export downloads all rifle, optic and load profiles; import merges a file back in, replacing same-named profiles and adding the rest. Non-export files are rejected and malformed entries skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM
Turret settings now take the turret's units (MOA / MRAD / cm) and a click value from common presets (1/8-1 MOA, 0.05-0.2 MRAD, 1/4-1 cm) or a custom value, and derive the cm-per-100 m click the turret math uses. Saved with the optic profile; older state and profiles that only have the cm value keep it exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new Saved gear card at the top of the page stores named profiles in the browser's
localStorage(bc-gear-v1), so you can switch setups without retyping.Export / import
bc-gear-YYYY-MM-DD.json, for backups or moving gear to another browser or phone.Other changes in the form
gr / gtoggle converts the value in place, like the other unit toggles, and the solver still works in grains internally.Testing
node test.js: 62 passed, including new tests for loading stored data, which fields each profile saves, grain/gram conversion, the caliber presets, export/import (round trip, replacing by name, rejecting bad files), and click presets (1/4 MOA = 0.727 cm, 0.1 MRAD = 1 cm, a 1/4 MOA turret dials 4 clicks per MOA, restoring and migrating saved click settings).clickCm = 0.3comes back as Custom 0.3 cm.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dh8dzr6LAKa4Fptz8uf6ZM