Skip to content

refactor: solid presets (@miodec)#7825

Open
Miodec wants to merge 13 commits intomasterfrom
solid-presets
Open

refactor: solid presets (@miodec)#7825
Miodec wants to merge 13 commits intomasterfrom
solid-presets

Conversation

@Miodec
Copy link
Copy Markdown
Member

@Miodec Miodec commented Apr 14, 2026

No description provided.

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Apr 14, 2026
Comment thread frontend/src/ts/collections/presets.ts Outdated
Comment thread frontend/src/ts/collections/presets.ts Outdated
@Miodec Miodec marked this pull request as ready for review May 5, 2026 08:37
Copilot AI review requested due to automatic review settings May 5, 2026 08:37
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels May 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ts collection 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.

Comment thread frontend/src/ts/pages/settings.ts
Comment thread frontend/src/ts/collections/presets.ts Outdated
}

// oxlint-disable-next-line typescript/explicit-function-return-type
export function usePresetsLiveQuery() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we rename to ConfigPresets for more clarity? We have FilterPresets as well

Comment thread frontend/src/ts/collections/presets.ts Outdated
Comment thread frontend/src/ts/collections/presets.ts Outdated
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label May 5, 2026
@Miodec Miodec requested a review from Copilot May 5, 2026 17:11
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label May 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants