Skip to content

Refactor#111

Draft
Ntalcme wants to merge 44 commits into
mainfrom
refactor
Draft

Refactor#111
Ntalcme wants to merge 44 commits into
mainfrom
refactor

Conversation

@Ntalcme

@Ntalcme Ntalcme commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Ntalcme added 30 commits June 30, 2026 16:57
* Fix(lang/help): wrong pronoun used #102

* refactor(crownicles): dedupe data loaders via cachedPromise helper

Replace the promise-cache-and-evict boilerplate, copy-pasted across 6 loaders,
with a single cachedPromise() helper in data/source.ts. The five single-value
loaders (loadNames, loadItemIcons, loadMapTypeIcons, getCrowniclesMapGraph,
getContinentGraph) memoize through it; getItems keeps a per-category Map of
memoized loaders. Caching, deduplication of concurrent calls and
eviction-on-failure now live in one place.

Also drops the now-dead module-level promise variables, restores the export
accidentally lost on loadItemIcons, and documents the helper.

Closes #58

* refactor(crownicles): share the CrowniclesIcons parser between loaders

Extract crownicles-icons-source.ts (ICONS_SOURCE_PATH, fetchIconsSource,
extractIconBlock) so the item and map-type icon loaders stop each
re-implementing the `} = {` split + brace-matching + pair regex. The key
pattern is parameterized (\d+ for item ids, default \w+ for map codes), so
behaviour is unchanged.

Closes #61

* docs: tidy comments and fill JSDoc gaps

The codebase was already well-commented, so this is a focused pass:
- document computeLeagueBonusScore (as a Crownicles-formula mirror) and
  CROWNICLES_LEAGUES / CrowniclesLeague
- rewrite the terse CrowniclesMap* interface docs and the HelpState path*
  field comments (incl. the "choosed" typo); drop the redundant `// BFS` marker
- add concise JSDoc to ItemCategory, TitleSize, TextInputStyleName, the /mail
  modal ids, the reminder result types, pathfinderPage and the mail-repository
  helpers; move the misplaced homePage doc onto the export

Closes #79
Closes #80
Closes #81
Closes #82
Closes #83
@Ntalcme Ntalcme added this to the Refactor milestone Jul 2, 2026
@Ntalcme Ntalcme self-assigned this Jul 2, 2026
@Ntalcme Ntalcme added refactor Refactoring of code priority: high Urgent, do first labels Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high Urgent, do first refactor Refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant