Repository navigation
feat(settings): leave environments that can't store a setting out of its row #18361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
flamboh
wants to merge
23
commits into
pingdotgg:main
Choose a base branch
from
flamboh:t3/settings-unsupported-environments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,710
−475
Open
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d42da49
fix(web): warn when an environment silently drops a setting
flamboh b2dcb63
fix(web): catch nested setting keys dropped beside saved ones
flamboh 92ef200
feat(settings): leave environments that cannot store a setting out of…
flamboh 76e4607
refactor(web): read worktree cleanup from the environment's filtered …
flamboh 382a2e9
Merge remote-tracking branch 'origin/main' into t3/settings-unsupport…
flamboh d13abdb
Merge origin/main into t3/settings-unsupported-environments
flamboh 09376ca
fix(settings): disable unsupported children editors
flamboh f14fb70
test(settings): cover unsupported environments and partial saves
juliusmarminge ba56baa
chore: merge main into unsupported settings takeover
juliusmarminge 00a6a4b
fix(settings): filter unsupported targets without disabling supported…
juliusmarminge b8a5244
test(settings): restore Chromium coverage and catch dropped actions
juliusmarminge 7c4909c
fix(settings): honor supported targets in custom editors
juliusmarminge 8acd4f1
test(web): cover unsupported project settings destinations
juliusmarminge ac322ca
fix(settings): align project reads and permissions with supported tar…
juliusmarminge a5c98e7
fix(settings): allow device host edits with offline environments
juliusmarminge 2db26f2
test(web): cover project setting drops across scopes
juliusmarminge 6ad63d0
fix(settings): isolate learned project override support
juliusmarminge a65c70d
test(settings): cover model picker support eligibility
juliusmarminge 4e5d197
fix(settings): use eligible model provider catalogs
juliusmarminge b0809aa
merge: integrate main into settings support branch
juliusmarminge c3f7138
test(settings): reject partially saved project actions
juliusmarminge 9d28fcf
fix(web): reject partially saved project actions
juliusmarminge 03c33f7
merge: integrate main into settings support branch
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import type { EnvironmentId } from "@t3tools/contracts"; | ||
| import { Atom } from "effect/reactivity"; | ||
|
|
||
| import { appAtomRegistry } from "../../rpc/atomRegistry"; | ||
|
|
||
| interface DroppedSettingKeys { | ||
| readonly serverVersion: string; | ||
| readonly keys: ReadonlySet<string>; | ||
| } | ||
|
|
||
| /** | ||
| * Setting keys each environment dropped on a save this session, for servers | ||
| * too old to list the keys they store. Tagged with the server version, so an | ||
| * update clears them. | ||
| */ | ||
| export const droppedSettingKeysAtom = Atom.make<ReadonlyMap<EnvironmentId, DroppedSettingKeys>>( | ||
| new Map(), | ||
| ).pipe(Atom.keepAlive, Atom.withLabel("settings:dropped-setting-keys")); | ||
|
|
||
| export function recordDroppedSettingKeys( | ||
| environmentId: EnvironmentId, | ||
| serverVersion: string, | ||
| keys: readonly string[], | ||
| ) { | ||
| if (keys.length === 0) return; | ||
| appAtomRegistry.update(droppedSettingKeysAtom, (current) => { | ||
| const existing = current.get(environmentId); | ||
| const next = new Map(current); | ||
| next.set(environmentId, { | ||
| serverVersion, | ||
| keys: new Set([...(existing?.serverVersion === serverVersion ? existing.keys : []), ...keys]), | ||
| }); | ||
| return next; | ||
| }); | ||
| } | ||
|
|
||
| /** The keys an environment dropped, if it still runs the version that dropped them. */ | ||
| export function droppedSettingKeysFor( | ||
| dropped: ReadonlyMap<EnvironmentId, DroppedSettingKeys>, | ||
| environmentId: EnvironmentId, | ||
| serverVersion: string | undefined, | ||
| ): ReadonlySet<string> | undefined { | ||
| const entry = dropped.get(environmentId); | ||
| return entry && entry.serverVersion === serverVersion ? entry.keys : undefined; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.