Skip to content

feat(collection): search full inventories, preview ammo imports, and expand stats - #649

Merged
gogorichie merged 10 commits into
mainfrom
claude/blissful-hamilton-gmhgx0
Nov 20, 2026
Merged

gogorichie merged 10 commits into
mainfrom
claude/blissful-hamilton-gmhgx0

Conversation

@gogorichie

@gogorichie gogorichie commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Inventory and CSV imports

  • Search, filters, and sorting run across the signed-in user’s entire firearm or ammo inventory before the results are split into pages. Page links preserve the selection.
  • The Ammo page uses the same selection for displayed lots, total rounds, and caliber breakdowns.
  • Preview an ammo CSV to see how many lots and rounds it will add and which rows failed validation. A previously imported file needs a separate confirmation for another shipment. The database records each successful import together with its lots in one transaction.
  • Migration 011 adds per-user import history. Duplicate detection starts after the upgrade.

Navigation and reporting

  • The tabs are Overview, Firearms, Ammo, Collection Stats, and Settings. The shared + Add item menu opens either entry form. Feedback opens GitHub Issues from the footer.
  • Overview shows firearms and rounds on hand separately. A collection with ammo lots, including zero-round lots, skips the first-record prompt.
  • Collection Stats lists total ammunition rounds and rounds by caliber. Selecting a caliber opens its matching lots, including Unspecified for older records without a caliber.
  • Print insurance report opens the printable report from Collection Stats. The Firearms shortcut remains available. The report lists ammo quantities and locations alongside firearm records and keeps purchase value scoped to firearms.
  • A full-width Ammo On Hand card on each firearm detail page links to the matching caliber. The detail grid also gives long values room to wrap.

Verification

Regression coverage includes later-page search matches, sorting and filtered totals across pages, ammo-only collections, caliber links, and duplicate imports with stale and fresh confirmations. PR checks

claude and others added 4 commits November 19, 2026 04:13
…nce report

- Firearm detail page gets an Ammo On Hand card: rounds and lot count
  for the firearm's caliber, matched ignoring case and surrounding
  whitespace, linking to the ammo list filtered to that caliber.
- /ammo accepts ?caliber= to filter server-side across all pages.
- Insurance report adds an Ammunition section (quantities only; ammo
  has no price field, so it is excluded from the value total).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNK9JqzSmjsveDQGjDSNFS
A fourth card in the top row squeezed the 180px label column and
wrapped values one character per line at desktop widths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNK9JqzSmjsveDQGjDSNFS
At the 1192px max content width, minmax(280px) fit four grid tracks,
and the full-width Notes card kept auto-fit from collapsing the empty
one. With the fixed 180px label column that left ~60px for values.
A 360px minimum caps the grid at three tracks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNK9JqzSmjsveDQGjDSNFS
@gogorichie gogorichie changed the title feat(ammo): ammo on hand card on firearm page + ammo in insurance report feat(collection): clarify navigation and include ammo in firearm records and reports Nov 20, 2026
@gogorichie gogorichie changed the title feat(collection): clarify navigation and include ammo in firearm records and reports feat(collection): add ammo stats, update navigation, and include ammo in reports Nov 20, 2026
Scope totals to filtered lots, add ammo to Overview, and connect Collection Stats to the matching lots and printable insurance report.
@gogorichie gogorichie changed the title feat(collection): add ammo stats, update navigation, and include ammo in reports feat(collection): search full inventories, preview ammo imports, and expand stats Nov 20, 2026
@gogorichie
gogorichie marked this pull request as ready for review November 20, 2026 06:33
@gogorichie
gogorichie merged commit b7a15d2 into main Nov 20, 2026
8 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T06:35:55.210360Z 0e75f6e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e75f6ecab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +75 to +79
items, fields, facetOptions, selected, q, field, caliberFilter, unspecified,
sort: params.get('sort') || '',
hasFilters: Boolean(q || caliberFilter || unspecified || facets.some(f => selected[f].length)),
pagination: { totalCount, totalPages, currentPage, perPage, hasNext: currentPage < totalPages, hasPrevious: currentPage > 1 },
queryString: params.toString()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep search orchestration outside the SQL-only repository layer

The new repository constructs URL query strings, normalizes request parameters, chooses pagination policy, and assembles template state, while both services simply forward its result. This violates the explicit AGENTS.md requirement that repositories remain SQL-only and couples database access to the HTTP/view contract. Move request normalization and view-model construction into the services or shared utilities, leaving the repository responsible for executing queries and returning data.

AGENTS.md reference: AGENTS.md:L46-L49

Useful? React with 👍 / 👎.

Comment on lines +55 to +57
if (selected[facet].length) {
conditions.push(`LOWER(TRIM(${facet})) IN (${selected[facet].map(() => '?').join(',')})`);
args.push(...selected[facet]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use consistent case normalization for facet comparisons

For a facet value containing an uppercase non-ASCII character, such as manufacturer Česká zbrojovka, selecting its checkbox now hides the matching lot. JavaScript's toLowerCase() converts Č to č, but SQLite's built-in LOWER() leaves it unchanged, so the predicate compares different strings. The previous client-side filtering normalized both operands in JavaScript. Use the same normalization on both sides and add a regression test with an accented uppercase facet value.

Useful? React with 👍 / 👎.

Comment thread README.md
Comment on lines +12 to +13
Use **Overview**, **Firearms**, **Ammo**, **Collection Stats**, and **Settings** to navigate.
Open **+ Add item** in the header and choose **Add firearm** or **Add ammo**. Use **Feedback** in the footer to open GitHub Issues.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the public site and screenshots for the new interface

This commit changes navigation, inventory search, ammunition imports, and collection statistics, but updates only the README; docs/index.html and docs/screenshots/ remain unchanged and still present the previous interface. AGENTS.md explicitly requires updating both public-site content and screenshots when user-facing features change. Bring those assets into sync with the new workflows before shipping.

AGENTS.md reference: AGENTS.md:L156-L157

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is included in version 2.9.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants