Repository navigation
Conversation
The merge of #2097 into the merge train replaced the end of docs/en/gameui.md and docs/zh/gameui.md with an older copy, dropping the custom widget, credits, dropdown menu, grid layout, text input, pointer filter, rich label and accessibility node sections that #2291, #2292, #2293, #2294, #2295, #2305, #2354 and #2402 added, and left two settings-menu text scale paragraphs that said the same thing. Restore the sections, describe the code as it now behaves, and merge the two paragraphs into one.
The commit of the closed #2356 reached main through a merge and replaced the `Credits` type, its `Valid` method and the `Author` field that #2354 added and 0.4.0 released with a near-duplicate `CreditsModel`. Restore `Credits`, keep the stable `Sorted` from the duplicate as a method on it, drop `CreditsModel` (nothing used it), and fold its note into the credits note.
#2089 added `a11y.CaptionBridge` for #1774 while another pull request for the same issue added `a11y.CaptionEmitter` and `cutscene.CaptionBridge`, and the merge train kept both. Its `ShowSFXAt` duplicated `CaptionEmitter.Emit` on a separate clock, its `SyncDialogue` duplicated `cutscene.CaptionBridge`, nothing used it, it was never released, and the guide sections it added to the sound and cutscene pages repeated the existing headings and told cutscene authors to use it instead of the documented bridge. Remove it with its docs, changelog fragment and note, and record the rejected alternative in the captioned sound and dialogue note.
…ment #2097 was a second attempt at #1772 and added a second agent note and a second changelog fragment for the settings menu text scale range, which the first note and the `1772-gameui-text-scale` fragment already describe. Fold the one reason the second note added into the first and drop the duplicates, so the release notes list the change once.
…erFilter #2294 made `ShouldConsume` true for `PointerPass`, while `ResolvePointerFilter` and the guide say a pass filter reports the hit and lets it propagate. Only `PointerStop` consumes now, and the filter constants have doc comments.
#2291 computed the next index as `(i + step + len) % len`, which is negative and panics for a step or an index beyond one length below zero, such as `NextEnabled(0, -5)`, and it could land on an item without an ID that `Selectable` refuses. Move one item in the direction of the step, start an out-of-range index from the matching end, and skip exactly the items `Selectable` refuses.
#2293 removed only C0 controls and DEL with `PrintableOnly`, so C1 controls such as U+0085 NEXT LINE reached the native field. Use `unicode.IsControl`, document that invalid UTF-8 becomes U+FFFD, and add doc comments to the keyboard kinds and options.
#2305 treated an unnamed group as accessible in `Accessible` but as missing a name in `RequiresName`. Exempt groups in both, and add doc comments to the roles.
#2292 said it covered invalid inputs, but spacing wider than the bounds produced negative cell sizes and its test covered none of the normalizations. Clamp cell sizes at zero and test zero counts, zero columns, negative spacing and oversized spacing.
#2402 made a `Custom` with a nil `Impl` focusable, and its only test checked that a new root is not nil. A nil `Impl` is no longer focusable, and the tests now measure, lay out and draw a custom widget and cover `Focusable` and `HitTest`.
#2295 searched for the closing bracket of a tag across newlines and nested brackets, so in `a [b [link=x]X[/link]` it read `[b [link=x]` as one literal tag, lost the link and miscounted offsets that ParseRich renders differently. Scan for the bracket the way ParseRich does.
This branch has not been deployed
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.
Follow-up review of the gameui, a11y and text pull requests the merge train landed without CI. Each section is checked against current
main.#2089 feat(a11y): bridge sound and dialogue captions
Duplicate. Another pull request for #1774 had already added
a11y.CaptionEmitterandcutscene.CaptionBridge, and the merge kept both.a11y.CaptionBridge.ShowSFXAtduplicatedCaptionEmitter.Emiton a separate clock the game had to advance itself,SyncDialogueduplicatedcutscene.CaptionBridge, and nothing used it. Its guide sections repeated the existingCaptions for positional soundsandCaptions for dialogueheadings (breaking the anchorsa11y.mdlinks to) and told cutscene authors to call it fromOnDialogueinstead of the documented bridge. It was never released (0.4.0 does not contain it), and a zero-valueCaptionBridge{Track: t}panicked on its nil map.This PR removes
pkg/a11y/bridges.go, its test, its doc sections ina11y.md,sound.mdandcutscene.md(en and zh), its changelog fragment and its note, and records the rejected alternative in the captioned sound and dialogue note.#2097 fix(gameui): honor full text scale range
The code landed intact:
SettingsMenu.applyThemeusessave.MinCaptionScale–save.MaxCaptionScale. As a second attempt at #1772 it added a second agent note and a second changelog fragment for the same change, and two paragraphs in the gameui guide that said the same thing. This PR folds the second note into the first, drops the duplicate fragment, and merges the paragraphs.Its merge into the train also replaced the end of
docs/en/gameui.mdanddocs/zh/gameui.mdwith an older copy, which removed every section the PRs below added.Closes #1772overstates it: the issue's acceptance also asks forRoot.HUDScaleand a HUD scale row, aCheckScreenminimum text size issue (IssueTextTooSmall), defaulting the root scale to the player setting orEnv().FontScale(), and before/after screenshots. None of these exist, and the issue is closed.#2291 feat(gameui): add dropdown menu model
The guide section was lost (restored here).
Menu.NextEnabledcomputed(i + step + len) % len, which is negative and panics for a large negative step or index, such asNextEnabled(0, -5), and it could return an item without an ID thatSelectablerefuses. It now moves one item in the step's direction, starts an out-of-range index from the matching end, and skips exactly whatSelectablerefuses, with a table test.#2292 feat(gameui): add deterministic grid layout helper
The guide section was lost (restored). The body says invalid inputs are covered by tests, but none were. Spacing wider than the bounds gave negative cell sizes. Cell sizes are now clamped at zero, and the tests cover zero counts, zero columns, negative spacing and oversized spacing.
#2293 feat(gameui): add portable text input validation
The guide section was lost (restored).
PrintableOnlyremoved only C0 controls and DEL, so C1 controls such as U+0085 reached the field. It now usesunicode.IsControl. Also added: a doc note that invalid UTF-8 becomes U+FFFD, and doc comments onKeyboardKindconstants andTextInputOptionsfields.#2294 feat(gameui): add pointer filter contract
The guide section was lost (restored).
ShouldConsumereturned true forPointerPass, which contradictsResolvePointerFilterand the guide. OnlyPointerStopconsumes now, a test pins the two together, and the constants have doc comments.#2295 feat(gameui): add rich text link model
The guide section was lost (restored).
ParseRichLinkssearched for a tag's]across newlines and nested[, unlikeParseRich, so ina [b [link=x]X[/link]the link was lost. It now scans the wayParseRichdoes, with a test. Not changed here (open in #1417):ParseRichhas nolinktag, soRichText.PlainTextstill contains the literal[link=…]markup thatParseRichLinksexcludes from its offsets. Unmatched closing tags are also handled differently by the two parsers.#2305 feat(gameui): add accessibility node model
The guide section was lost (restored).
Accessibletreated an unnamed group as accessible, butRequiresNameflagged it. Groups are now exempt in both, a test checks that the two are inverses for visible nodes, and the roles have doc comments.#2354 feat(gameui): add credits about model
Overwritten. The commit of the closed #2356 reached
mainthrough a merge and replacedCredits,Credits.ValidandCreditEntry.Authorwith a near-duplicateCreditsModel. 0.4.0 had already releasedCreditsand its changelog entry. This PR restoresCreditsand keeps that attempt's stableSortedas a method on it.CreditsModelis removed because nothing used it, and its note is folded into the credits note. The guide section is restored.#2402 feat: add gameui custom widget adapter
The guide section was lost (restored). The only test,
TestCustomWidgetMeasuresAndDraws, did not measure, lay out or draw anything. It only checked thatNewRootreturns non-nil. ACustomwith a nilImplwas focusable. It no longer is, and the tests now cover measurement withMinWidth, layout, drawing,FocusableandHitTest. The adapter still has no activation or pointer input path for the widget (customPointeris declared but unused), so #1412 stays open.Not in this PR
Other lines that the same merge dropped from the gameui guide belong to other pull requests:
l10n.MirrorRect/ReadingOrder, themestyleBoxes, andtext.TextEffects. Thesound.mdpositional caption section also contains unrelated paragraphs (animation sounds, scene emitters, sound and music resources, dynamics, software mixer) that other merges left in the wrong section.Verification
go tool nsgo test ./pkg/gameui/... ./pkg/text/... ./pkg/a11y/... ./pkg/cutscene/...: pass.go tool nsgo checkon./pkg/gameui/...,./pkg/text/...and./pkg/a11y/...: pass.go tool nsgo test ./internal/repocheck/...: pass.go run ./tools/changelog checkandbun run verify-notes: pass.Screenshots
None