Merge branch 'dev'
This commit is contained in:
commit
46ed89752b
|
|
@ -370,7 +370,19 @@ export function renderShell(opts: ShellOptions): string {
|
||||||
});
|
});
|
||||||
if (infoClose) infoClose.addEventListener('click', hideInfoPanel);
|
if (infoClose) infoClose.addEventListener('click', hideInfoPanel);
|
||||||
|
|
||||||
// Reset when switching tabs
|
// Auto-show on first visit per rApp (checks localStorage, shows once then never again)
|
||||||
|
function autoShowIfFirstVisit(mid) {
|
||||||
|
if (!mid || mid === 'rspace') return; // skip canvas
|
||||||
|
try {
|
||||||
|
var key = 'rapp_info_seen_' + mid;
|
||||||
|
if (localStorage.getItem(key)) return; // already seen
|
||||||
|
if (!localStorage.getItem('encryptid_session')) return; // not logged in
|
||||||
|
localStorage.setItem(key, '1');
|
||||||
|
setTimeout(function() { showInfoPanel(mid); }, 800);
|
||||||
|
} catch(e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset when switching tabs — auto-show for newly visited rApps
|
||||||
document.addEventListener('layer-view-mode', hideInfoPanel);
|
document.addEventListener('layer-view-mode', hideInfoPanel);
|
||||||
const tb = document.querySelector('rstack-tab-bar');
|
const tb = document.querySelector('rstack-tab-bar');
|
||||||
if (tb) {
|
if (tb) {
|
||||||
|
|
@ -378,20 +390,14 @@ export function renderShell(opts: ShellOptions): string {
|
||||||
hideInfoPanel();
|
hideInfoPanel();
|
||||||
// Reset cached module so next open loads fresh content for new tab
|
// Reset cached module so next open loads fresh content for new tab
|
||||||
infoPanel.dataset.loadedModule = '';
|
infoPanel.dataset.loadedModule = '';
|
||||||
|
// Auto-show info panel if this is the user's first visit to this rApp
|
||||||
|
var switchedModuleId = e.detail && e.detail.moduleId;
|
||||||
|
if (switchedModuleId) autoShowIfFirstVisit(switchedModuleId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-show on first visit per rApp
|
// Auto-show on initial page load
|
||||||
const seenKey = 'rapp_info_seen_' + '${escapeAttr(moduleId)}';
|
autoShowIfFirstVisit('${escapeAttr(moduleId)}');
|
||||||
if (!localStorage.getItem(seenKey)) {
|
|
||||||
// Only auto-show for logged-in users (not on first-ever visit)
|
|
||||||
try {
|
|
||||||
if (localStorage.getItem('encryptid_session')) {
|
|
||||||
setTimeout(() => { showInfoPanel('${escapeAttr(moduleId)}'); }, 800);
|
|
||||||
localStorage.setItem(seenKey, '1');
|
|
||||||
}
|
|
||||||
} catch(e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Expose for tour integration
|
// Expose for tour integration
|
||||||
window.__rspaceShowInfo = showInfoPanel;
|
window.__rspaceShowInfo = showInfoPanel;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue