Skip to content

Let default splitting options be stored in database#366

Open
Uli-Z wants to merge 1 commit intospliit-app:mainfrom
Uli-Z:serverside-default-split-options
Open

Let default splitting options be stored in database#366
Uli-Z wants to merge 1 commit intospliit-app:mainfrom
Uli-Z:serverside-default-split-options

Conversation

@Uli-Z
Copy link
Copy Markdown
Contributor

@Uli-Z Uli-Z commented Jun 24, 2025

See Issue #327
I corrected this behavior so that default splitting options are stored group-wide in the database.

Summary

  • Introduced a new defaultSplittingOptions JSON column in the Group table via migration so groups can store their default split mode server‑side
  • Updated the Prisma model to include this optional field, enabling persistence of these defaults across devices
  • Exposed an updateDefaultSplittingOptions mutation on the groups router to modify these settings through TRPC
  • Reworked the ExpenseForm to retrieve defaults from the group data and send updates via the new mutation instead of localStorage

@Uli-Z Uli-Z closed this Jun 24, 2025
@Uli-Z Uli-Z deleted the serverside-default-split-options branch June 24, 2025 08:57
@Uli-Z Uli-Z restored the serverside-default-split-options branch June 24, 2025 09:44
@Uli-Z Uli-Z reopened this Jun 24, 2025
@Uli-Z Uli-Z force-pushed the serverside-default-split-options branch 3 times, most recently from 28113ef to 811f6b1 Compare November 11, 2025 15:34
This commit refactors the "default splitting options" feature to be stored on the server-side instead of in the client's localStorage. This provides a more consistent user experience, as the setting will now persist across different devices and browsers for all members of a group.

The following changes were made:
- The Group model in prisma.schema.prisma has been updated with a new defaultSplittingOptions JSON field.
- A database migration has been added to apply this schema change.
- The ExpenseForm component in expense-form.tsx has been updated to:
  - Fetch the default splitting options from the group object, which is populated from the database.
  - Use a new tRPC mutation, updateDefaultSplittingOptions, to persist the user's chosen default options back to the server.
  - All logic related to localStorage for this feature has been removed.

Fixes spliit-app#327
@Uli-Z Uli-Z force-pushed the serverside-default-split-options branch from 811f6b1 to 375e0c6 Compare December 7, 2025 19:32
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.

1 participant