Conversation
fehmer
reviewed
Apr 17, 2026
fehmer
reviewed
Apr 17, 2026
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors preset handling on the frontend to use a new Solid collection instead of storing presets on the legacy snapshot object. This fits the ongoing Solid migration by moving preset reads/writes onto reactive collection APIs.
Changes:
- Adds a new
collections/presets.tscollection with live query + optimistic add/edit/delete actions. - Updates settings, preset modal, preset controller, and command-line preset list to read from the new collection.
- Removes preset data/types from the legacy snapshot initialization path.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/src/ts/pages/settings.ts |
Swaps preset rendering to collection-backed data and live updates. |
frontend/src/ts/modals/edit-preset.ts |
Replaces direct API/snapshot preset mutations with collection actions. |
frontend/src/ts/db.ts |
Seeds presets into the new collection during snapshot init. |
frontend/src/ts/controllers/preset-controller.ts |
Applies presets from the new collection API. |
frontend/src/ts/constants/default-snapshot.ts |
Removes preset storage/type from snapshot. |
frontend/src/ts/commandline/lists/presets.ts |
Reads command-line preset list from the collection. |
frontend/src/ts/collections/presets.ts |
Introduces the new preset collection and optimistic mutations. |
fehmer
reviewed
May 5, 2026
| } | ||
|
|
||
| // oxlint-disable-next-line typescript/explicit-function-return-type | ||
| export function usePresetsLiveQuery() { |
Member
There was a problem hiding this comment.
should we rename to ConfigPresets for more clarity? We have FilterPresets as well
| presetsEl?.appendHtml(` | ||
| <div class="buttons preset" data-id="${preset._id}" data-name="${preset.name}" data-display="${preset.display}"> | ||
| <button class="presetButton">${preset.display}</button> | ||
| <div class="buttons preset" data-id="${preset._id}" data-name="${preset.name}"> |
| <div class="buttons preset" data-id="${preset._id}" data-name="${preset.name}" data-display="${preset.display}"> | ||
| <button class="presetButton">${preset.display}</button> | ||
| <div class="buttons preset" data-id="${preset._id}" data-name="${preset.name}"> | ||
| <button class="presetButton">${preset.name}</button> |
| snapshot.presets.forEach((preset) => { | ||
| if (presets.length === 0) return; | ||
| presets.forEach((preset) => { | ||
| const dis = preset.display; |
| mutationFn: async ({ name, config, settingGroups }) => { | ||
| const response = await Ape.presets.add({ | ||
| body: { | ||
| name: name.replace(/_/g, " "), |
| // if this is missing getPreset is out of sync | ||
| presetsCollection.utils.writeUpdate({ | ||
| _id: presetId, | ||
| name, |
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.
No description provided.