feat(web): anchor the composer settings sheet to the clicked value button - #1627
Open
KorenKrita wants to merge 1 commit into
Open
feat(web): anchor the composer settings sheet to the clicked value button#1627KorenKrita wants to merge 1 commit into
KorenKrita wants to merge 1 commit into
Conversation
…'s section The model/effort value buttons and the gear all opened the identical full settings sheet from the top, so clicking Effort still landed on the Model section. Anchor the open instead: the model button expands only the Model area (incl. Cursor variant drill-down), the effort button only the Effort/Reasoning area, and the gear keeps the full sheet. Clicking the other value button while open switches sections in place; clicking the gear over an anchored sheet expands it to the full sheet; re-clicking the same trigger closes (preserves the tiann#1475 toggle-close behavior).
There was a problem hiding this comment.
Findings
- None.
Questions
- None.
Summary
- Review mode: initial. No reportable issues found in the latest full diff. Residual coverage risk: the added tests do not exercise effort → model, full-sheet → anchored transitions, or Cursor drill-down followed by gear expansion.
Testing
- Not run (automation). At review time, the GitHub
integrationcheck passed;testandpr-reviewwere pending.
HAPI Bot
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.
Problem
Since #1475 the composer shows
[model]and[effort]value buttons whose captions are the current values. Clicking either one opened the same full settings sheet as the gear, always rendered from the top in the fixed order Model → Effort → Permission → other. So clicking Effort never took you to Effort — you landed on the Model section and had to scroll past every model row to reach the control you asked for. The label on the button promised a specific destination the sheet did not deliver.Changes
HappyComposergains asettingsSectionstate ('model' | 'effort' | null) that anchors the open sheet:nullanchor).Implementation notes:
overlaysmemo (sheetModelSettings,sheetEffortSettings, …), so the section-divider conditions keep working and a single visible area never renders a leading, trailing, or orphaned divider.handleGearToggleis a zero-arg wrapper for the DOMonClickconsumer, so aMouseEventcan never leak into thesectionparameter.modelValueOpen/effortValueOpennow highlight only while their own area is expanded, instead of both lighting up whenever the sheet was open.dismissSettingsclears the anchor along with the sheet and the Cursor drill-down, so no stale anchor can survive a dismissal.Unchanged: the outside-click dismissal exemption for all three triggers, Pi's mid-turn control liveness (
configurationControlsDisabled, #1442), the Cursor variant drill-down flow, and narrow-viewport behaviour (value buttons hidden, gear opens the full sheet).Testing
web: 2558 tests pass,bunx tsc --noEmitclean.HappyComposer.modelEffortButtonscoverage: anchored open from each value button (asserting the other sections stay collapsed), in-place section switching, gear opening the full sheet, and the gear expanding an already-anchored sheet.