fix: frontend directory tree (#363)
Some checks are pending
CI / test (macos-latest, 3.10) (push) Waiting to run
CI / test (macos-latest, 3.11) (push) Waiting to run
CI / test (macos-latest, 3.12) (push) Waiting to run
CI / test (macos-latest, 3.13) (push) Waiting to run
CI / test (macos-latest, 3.8) (push) Waiting to run
CI / test (macos-latest, 3.9) (push) Waiting to run
CI / test (ubuntu-latest, 3.10) (push) Waiting to run
CI / test (ubuntu-latest, 3.11) (push) Waiting to run
CI / test (ubuntu-latest, 3.12) (push) Waiting to run
CI / test (ubuntu-latest, 3.13) (push) Waiting to run
CI / test (ubuntu-latest, 3.8) (push) Waiting to run
CI / test (ubuntu-latest, 3.9) (push) Waiting to run
CI / test (windows-latest, 3.10) (push) Waiting to run
CI / test (windows-latest, 3.11) (push) Waiting to run
CI / test (windows-latest, 3.12) (push) Waiting to run
CI / test (windows-latest, 3.13) (push) Waiting to run
CI / test (windows-latest, 3.8) (push) Waiting to run
CI / test (windows-latest, 3.9) (push) Waiting to run
CI / frontend (push) Blocked by required conditions
OSSF Scorecard / Scorecard analysis (push) Waiting to run

Co-authored-by: ix-56h <n.guintini@protonmail.com>
This commit is contained in:
Zarial 2025-07-03 03:51:59 +02:00 committed by GitHub
parent 789d44e986
commit 0fcf8a956f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,9 +190,22 @@ function handleSubmit(event, showLoading = false) {
// Set plain text content for summary, tree, and content
document.getElementById('result-summary').value = data.summary || '';
document.getElementById('directory-structure-content').value = data.tree || '';
document.getElementById('directory-structure-pre').textContent = data.tree || '';
document.getElementById('result-content').value = data.content || '';
// Populate directory structure lines as clickable <pre> elements
const dirPre = document.getElementById('directory-structure-pre');
if (dirPre && data.tree) {
dirPre.innerHTML = '';
data.tree.split('\n').forEach(line => {
const pre = document.createElement('pre');
pre.setAttribute('name', 'tree-line');
pre.className = 'cursor-pointer hover:line-through hover:text-gray-500';
pre.textContent = line;
pre.onclick = function() { toggleFile(this); };
dirPre.appendChild(pre);
});
}
// Scroll to results
resultsSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
})