MCPcopy Create free account
hub / github.com/error311/FileRise / updateInactivePanePlaceholder

Function updateInactivePanePlaceholder

public/js/fileListView.js:2193–2284  ·  view source on GitHub ↗
(inactiveKey)

Source from the content-addressed store, hash-verified

2191}
2192
2193function updateInactivePanePlaceholder(inactiveKey) {
2194 if (!window.dualPaneEnabled) return;
2195 const container = document.getElementById('fileListContainerSecondary');
2196 if (!container) return;
2197
2198 const ensurePlaceholderElements = () => {
2199 let hintEl = container.querySelector('.file-list-dual-hint');
2200 if (!hintEl) {
2201 let actionsWrap = container.querySelector('.file-list-actions');
2202 const hasToolbar = actionsWrap && actionsWrap.querySelector('#fileListActions');
2203 if (!actionsWrap || hasToolbar) {
2204 actionsWrap = document.createElement('div');
2205 actionsWrap.className = 'file-list-actions';
2206 const title = container.querySelector('#fileListTitleSecondary');
2207 if (title && title.parentNode === container) {
2208 title.insertAdjacentElement('afterend', actionsWrap);
2209 } else {
2210 container.insertBefore(actionsWrap, container.firstChild);
2211 }
2212 }
2213
2214 hintEl = document.createElement('div');
2215 hintEl.className = 'file-list-dual-hint';
2216 hintEl.setAttribute('data-i18n-key', 'dual_pane_secondary_hint');
2217 hintEl.textContent = t('dual_pane_secondary_hint') || 'Select a folder to open here.';
2218 actionsWrap.appendChild(hintEl);
2219 }
2220
2221 let emptyEl = container.querySelector('#fileListSecondary .empty-state');
2222 const listEl = container.querySelector('#fileListSecondary');
2223 if (!emptyEl && listEl && listEl.childElementCount === 0) {
2224 listEl.classList.add('file-list-secondary-empty');
2225 emptyEl = document.createElement('div');
2226 emptyEl.className = 'empty-state';
2227 emptyEl.setAttribute('data-i18n-key', 'dual_pane_secondary_empty');
2228 emptyEl.textContent = t('dual_pane_secondary_empty') || 'Select a folder to open in the right pane.';
2229 listEl.appendChild(emptyEl);
2230 }
2231
2232 return { hintEl, emptyEl };
2233 };
2234
2235 const state = getPaneState(inactiveKey);
2236 const paneSourceId = (state && typeof state.sourceId === 'string')
2237 ? state.sourceId.trim()
2238 : '';
2239 const labelSourceId = paneSourceId || readStoredPaneSource(inactiveKey);
2240 let folder = (state && typeof state.currentFolder === 'string')
2241 ? state.currentFolder.trim()
2242 : '';
2243 if (!folder) {
2244 folder = readStoredPaneFolder(inactiveKey, labelSourceId);
2245 }
2246 const label = folder === 'root' ? getRootCrumbLabel(labelSourceId) : folder;
2247
2248 const ensured = ensurePlaceholderElements();
2249
2250 const titleEl = document.getElementById('fileListTitleSecondary');

Callers 2

setActivePaneFunction · 0.85

Calls 8

getPaneStateFunction · 0.85
readStoredPaneSourceFunction · 0.85
readStoredPaneFolderFunction · 0.85
tFunction · 0.85
refreshSourceBadgesFunction · 0.85
formatBreadcrumbTextFunction · 0.85
getRootCrumbLabelFunction · 0.70

Tested by

no test coverage detected