Skip to content

refactor: update getter type (@miodec)#8158

Merged
Miodec merged 6 commits into
masterfrom
get-word-type
Jun 24, 2026
Merged

refactor: update getter type (@miodec)#8158
Miodec merged 6 commits into
masterfrom
get-word-type

Conversation

@Miodec

@Miodec Miodec commented Jun 24, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 21:43
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jun 24, 2026
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors test word getters to model “may be missing” values (string | undefined) and threads that through generation/UI logic to satisfy TS and avoid runtime crashes on out-of-range access.

Changes:

  • Words.getText(i) now returns string | undefined and callers updated accordingly.
  • Word generation updated to accept previousWord possibly undefined and guard punctuation/capitalization logic.
  • Multiple UI/logic call sites updated to handle missing words safely (nullish checks / fallbacks).

Reviewed changes

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

Show a summary per file
File Description
frontend/src/ts/test/words-generator.ts Accept previousWord as optional; guard last-char and raw-cleaning logic
frontend/src/ts/test/test-words.ts Updates getText(i) overload to return string | undefined
frontend/src/ts/test/test-ui.ts Guards getText(i) results during render/update paths
frontend/src/ts/test/test-logic.ts Avoids crash when accessing .length of missing word during finish/progress calc
frontend/src/ts/test/practise-words.ts Handles getText(i) possibly undefined when building missed biwords
frontend/src/ts/test/pace-caret.ts Updates length accesses to tolerate undefined word lookups
frontend/src/ts/test/british-english.ts Accepts previousWord as optional; guards exception checks
frontend/src/ts/input/helpers/word-navigation.ts Handles possibly-missing next/prev word when calling Funbox.toggleScript

Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts Outdated
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/input/helpers/word-navigation.ts Outdated
Comment thread frontend/src/ts/input/helpers/word-navigation.ts Outdated
Comment thread frontend/src/ts/test/test-ui.ts Outdated
Comment thread frontend/src/ts/test/practise-words.ts Outdated
fehmer
fehmer previously approved these changes Jun 24, 2026
@github-actions github-actions Bot removed the waiting for review Pull requests that require a review before continuing label Jun 24, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Miodec and others added 2 commits June 24, 2026 23:49
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Miodec Miodec requested a review from Copilot June 24, 2026 21:58
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/test-ui.ts Outdated
Comment thread frontend/src/ts/test/practise-words.ts Outdated
Miodec and others added 2 commits June 25, 2026 00:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
@Miodec Miodec merged commit 8d51a92 into master Jun 24, 2026
16 checks passed
@Miodec Miodec deleted the get-word-type branch June 24, 2026 22:06
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