Skip to content

Categories for iHateMoney category servers + optional title-based suggestion - #105

Closed
modularidea wants to merge 8 commits into
InteractionEngineer:mainfrom
modularidea:feat/ihm-categories
Closed

modularidea wants to merge 8 commits into
InteractionEngineer:mainfrom
modularidea:feat/ihm-categories

Conversation

@modularidea

@modularidea modularidea commented Oct 14, 2026 •

Copy link
Copy Markdown

What

Bill categories for iHateMoney, and an optional category suggestion from the bill title.

Upstream already shows/edits categories for Cospend. iHateMoney itself has no categories, but servers exist that add them wire-compatible with Cospend (categoryid, paymentmodeid, /categories, and a features list in the project info). This PR makes the app use them there. On a server without categories (the official one) the app keeps the category on the device instead. Nothing changes for Cospend.

Changes

  • Servers with categories (project info lists categoryid in features): categoryid / paymentmodeid are sent with bills ("" = none, since the form rejects 0); the project's categories and payment modes are loaded. Cospend's built-in negative ids are offered in the picker next to the project's own, as these servers accept them without listing them.
  • Servers without categories (stock iHateMoney): the 11 built-in categories can be assigned and are stored locally, per server/project/bill (new localBillCategory table, migration v5). Not synced, lost on reinstall. The request to the server is identical to before.
  • Settings (Projects tab → Categories): toggle "Suggest category from title", off by default. While typing the title of a new bill, a keyword match (longest phrase first, word-boundary safe; DE/EN shop and term lists) preselects the category. A manual choice always wins; existing bills keep their category.
  • Display: category and payment mode are shown as small tinted chips in the bill list (CategoryChip) instead of grey text. Emoji that default to text presentation (🌩 🛍) get the variation selector so they render in colour.
  • Strings in all six languages, README feature list.

Tests

  • New unit tests: text matching, classifier, tag/feature decoding, request params for stock vs. category servers, local store, view-model suggestion, icon/colour helpers.
  • Replaced testIHateMoney_loadTags_emitsEmptyWithoutSendingARequest (iHateMoney now reads the project info) by two tests: stock server → empty, category server → categories + features.
  • Whole PayForMeTests suite passes locally (198 tests).
  • Run end to end against the official ihatemoney.org (create bill, category kept locally and resolved) and a local category-enabled server in Docker (create, list, edit; categories in the list; suggestion in the bill form), in the simulator.

Notes

  • Not included: repeat fields of category-enabled servers (Bill has no model for them yet).
  • Known simulator quirk: on the iPhone 17e simulator emoji render as "?" boxes in menus; iPhone 17 (iOS 26.3 / 26.5) is fine.
  • Building with Xcode 27 needs IPHONEOS_DEPLOYMENT_TARGET >= 15 for the UI test target (14.0 in the project); not touched here.

🤖 Generated with Claude Code

modularidea and others added 2 commits October 14, 2026 10:49
Why: forks of iHateMoney add bill categories; the app showed them only for Cospend.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: new user-facing options.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@modularidea
modularidea marked this pull request as draft October 14, 2026 10:02
modularidea and others added 6 commits October 14, 2026 12:02
Why: Xcode re-sorted the entries of the new files on open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: Xcode touched it during local builds; not part of this feature.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: one line is enough for a feature list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: stock iHateMoney has no category field; categories are assigned and stored locally there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: stock iHateMoney keeps categories on the device now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why: tags were plain gray text, and some built-in icons rendered as monochrome glyphs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@modularidea
modularidea marked this pull request as ready for review October 14, 2026 11:10
@InteractionEngineer

Copy link
Copy Markdown
Owner

Hi @modularidea! Thank you for your contribution. Unfortunately I must reject it for the following reasons:

  • I can't see any human touch. Fully automated PR's with obvious AI language will always be rejected (as of now), as it implies high potential of slop (see following reasons).
  • Those changes weren't even tested on a real iOS Device. Why should they belong on the main or even in production?
  • No one asked for this feature, please see open issues first, especially as a first time contributer.
  • This feature is way too niche to ship to every user. IHateMoney is not the primary focus of PayForMe and changing the codebase for an uncommon version of the secondary backend of this app is not reasonable, I recon.

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.

2 participants