Skip to content

fix: server title from live state after loader recovery - #107

Merged
Flash303 merged 1 commit into
mainfrom
dev
Oct 12, 2026
Merged

Flash303 merged 1 commit into
mainfrom
dev

Conversation

@Flash303

Copy link
Copy Markdown
Owner

This pull request refactors and centralizes the logic for generating and applying SEO meta tags for server detail pages. The main improvements include moving the getServerDocumentMeta function to a shared utility, updating the meta synchronization logic, and adding comprehensive tests for SEO meta behavior.

SEO meta generation and application improvements:

  • Moved the getServerDocumentMeta function from server-detail/index.tsx to the shared seo-meta.ts utility, ensuring consistent meta tag generation across the app and reducing code duplication. ([[1]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-8030e4f1cfc9f15645bee27fea6e41bd59870f6cca847717a08f98a21891eb55L85-L106), [[2]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-6cf440cdf9d2642baf42deb78565c3ea085529b05446efe4382fa96481f06770R63-R81))
  • Updated the server detail page to use the centralized getServerDocumentMeta and to apply meta tags dynamically on client-side navigation using useEffect. ([[1]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-8030e4f1cfc9f15645bee27fea6e41bd59870f6cca847717a08f98a21891eb55L1-R7), [[2]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-8030e4f1cfc9f15645bee27fea6e41bd59870f6cca847717a08f98a21891eb55L1-R7)51)
  • Added a syncLiveTitle flag to the RouteMetaHandle interface and set it for the server detail route, allowing live updates of the document title and description without interference from the global meta sync logic. ([[1]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-6cf440cdf9d2642baf42deb78565c3ea085529b05446efe4382fa96481f06770R51), [[2]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-8030e4f1cfc9f15645bee27fea6e41bd59870f6cca847717a08f98a21891eb55L1-R7)24, [[3]](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-3a5f440e6650986a9891277279d4d6bbd6e25d360d4a966dee27510b0ce1dbc1L19-R21))

Testing and reliability:

  • Added a comprehensive test suite for seo-meta.ts, verifying translation fallback behavior, language resolution, and correct meta generation for different server states (online, offline, not found). ([frontend/app/core/lib/seo-meta.test.tsR1-R92](https://github.com/Flash303/minecraft-stats/pull/107/files#diff-409a49d71ad452b934b87337c2c066b5db2703d0046d70e3e5214e14900cf193R1-R92))

These changes improve maintainability, ensure correct SEO meta behavior, and make it easier to test and extend meta tag logic in the future.

@Flash303
Flash303 merged commit 0d11223 into main Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant