Repository navigation
fix: default request location and segmented indicator entry animation - #1657
Open
SameDesu123 wants to merge 1 commit into
Open
SameDesu123 wants to merge 1 commit into
SameDesu123 wants to merge 1 commit into
Conversation
- Initialize requestLocation to '' in setDatabase so the segmented control shows Default selected for new and existing saves. - When SegmentedControl goes from no selection to a selection, place the indicator at the target and fade it in instead of sliding from the left.
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.
PR Checklist
Summary
On the web build, Advanced Settings > Request Location showed no option selected, even for a fresh save. Selecting an option from that state made the indicator slide in from the left edge instead of appearing on the chosen option.
Related Issues
None
Changes
src/ts/storage/database.svelte.ts:requestLocationwas never initialized insetDatabase, so it stayedundefinedand matched none of the segment values ('','eu','fedramp'). Addeddata.requestLocation ??= ''so both new and existing saves showDefaultselected.src/lib/UI/GUI/SegmentedControl.svelte: when there was no active option, the indicator style was cleared (x = 0, width 0), so the next selection animated from the left edge. Now, when going from no selection to a selection, the indicator is placed at the target without the transform/width transition and fades in. When the selection is removed, it fades out in place. The initial mount (no animation) and the slide between options are unchanged.Impact
requestLocation: ''is falsy, so therisu-locationheader is still not sent by default. Request behavior does not change.SegmentedControlchange affects every segmented control, but only in the "no matching value" state.Additional Notes
To check the animation now that the default is set, run
pnpm dev, open Advanced Settings, and run this in the devtools console:The indicator fades out in place. Clicking any option then makes it fade in on that option.
pnpm checkandsrc/lib/UI/GUI/guiRendering.test.tspass.Footnotes
Modifies the behavior of prompting, requesting, or handling responses from AI models. ↩
Over 80% of the code is AI generated. ↩