Add loader title hint for SPA navigation feedback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-26 22:29:45 +00:00
parent b54484c7ed
commit f08d3de0c8
3 changed files with 57 additions and 4 deletions

View File

@@ -523,6 +523,37 @@ NAVIGATION
Spa.action.reload(); // Reload current action
Spa.layout.update_nav(); // Call layout method
Loader Title Hint:
When navigating from a list to a detail page, you can provide a hint
for the page title to display while the action loads its data. This
provides immediate visual feedback instead of showing a blank or
generic title during the loading state.
Add data-loader-title-hint attribute to links:
<a href="<%= Rsx.Route('Contacts_View_Action', {id: contact.id}) %>"
data-loader-title-hint="<%= contact.name %>">
<%= contact.name %>
</a>
When the link is clicked:
1. document.title is immediately set to the hint value
2. The hint is passed to the action as this.args._loader_title_hint
3. Action can use the hint while loading, then replace with real title
Using the Hint in Actions:
async page_title() {
// Show hint while loading, real title when data is ready
if (this.is_loading() && this.args._loader_title_hint) {
return this.args._loader_title_hint;
}
return `Contact: ${this.data.contact.name}`;
}
The _loader_title_hint parameter is automatically filtered from URLs
generated by Rsx.Route(), so it never appears in the browser address
bar or generated links.
SESSION VALIDATION
After each SPA navigation (except initial load and back/forward), the client
validates its state against the server by calling Rsx.validate_session().