A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

style: put page name first in browser titles (#1703)

## Summary

* **Goal**: Make browser tab titles, bookmarks, and history entries
distinguishable across pages (including individual folders in the File
Manager).
* **Changes**:
- Reordered `<title>` so the page name comes first, followed by
`CrossPoint Reader`. Browser tabs usually truncate titles from the
right, and bookmark/history lists are sorted alphabetically by title —
putting the differentiating part first keeps it visible in both cases,
instead of every entry starting with `CrossPoint Reader - …`.
- On `FilesPage`, added a small JS hook that updates `document.title`
with the current subfolder leaf when a `path` query parameter is present
— previously all folders shared the same title.

| URL | Title before | Title after |
|-----|--------------|-------------|
| `/` | `CrossPoint Reader` | `CrossPoint Reader` _(unchanged)_ |
| `/settings` | `CrossPoint Reader - Settings` | `Settings - CrossPoint
Reader` |
| `/files` | `CrossPoint Reader - Files` | `Files - CrossPoint Reader` |
| `/files?path=/Books` | `CrossPoint Reader - Files` | `Books - Files -
CrossPoint Reader` |
| `/files?path=/Books/Fantasy` | `CrossPoint Reader - Files` | `Fantasy
- Files - CrossPoint Reader` |

## Additional Context

* Pure client-side change: `<title>` tags plus ~3 lines of JavaScript on
FilesPage. No network, behavior, or memory impact.
* The static `<title>` tag remains as a fallback if JS fails.
* `HomePage` title left as-is since the app name alone is the standard
convention for a root/home page.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it helps set the right
context for reviewers.

Did you use AI tools to help write this code? _**YES**_

authored by

Pietro Campagnano and committed by
GitHub
9dab5f47 ce22deab

+7 -2
+6 -1
src/network/html/FilesPage.html
··· 3 3 <head> 4 4 <meta charset="UTF-8" /> 5 5 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 - <title>CrossPoint Reader - Files</title> 6 + <title>Files - CrossPoint Reader</title> 7 7 <script src="/js/jszip.min.js"></script> 8 8 <style> 9 9 :root { ··· 1734 1734 <script> 1735 1735 // get current path from query parameter 1736 1736 const currentPath = decodeURIComponent(new URLSearchParams(window.location.search).get('path') || '/'); 1737 + 1738 + if (currentPath !== '/') { 1739 + const leaf = currentPath.split('/').filter(Boolean).pop(); 1740 + if (leaf) document.title = leaf + ' - Files - CrossPoint Reader'; 1741 + } 1737 1742 1738 1743 // Network status monitoring 1739 1744 let isNetworkOnline = navigator.onLine;
+1 -1
src/network/html/SettingsPage.html
··· 3 3 <head> 4 4 <meta charset="UTF-8" /> 5 5 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 - <title>CrossPoint Reader - Settings</title> 6 + <title>Settings - CrossPoint Reader</title> 7 7 <style> 8 8 :root { 9 9 --font-color: #333;