Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,12 @@ function createWarningBadge(warning) {

const persistentOwnerColorMap = new Map();

// ⚡ Bolt: Cache unattached template nodes and instantiate via cloneNode(false)
// instead of document.createElement() to reduce JS-to-C++ DOM instantiation
// overhead in O(N) table rendering loops.
const ownerBadgeTemplate = document.createElement('span');
ownerBadgeTemplate.className = 'owner-badge';

function createOwnerCellContent(owner) {
if (!owner) {
return createEmptyCell();
Expand All @@ -961,18 +967,20 @@ function createOwnerCellContent(owner) {
persistentOwnerColorMap.set(owner, OWNER_COLORS[persistentOwnerColorMap.size % OWNER_COLORS.length]);
}

const badge = document.createElement('span');
badge.className = 'owner-badge';
const badge = ownerBadgeTemplate.cloneNode(false);
badge.style.background = persistentOwnerColorMap.get(owner);
badge.textContent = owner;
return badge;
}

// ⚡ Bolt: Cache status badge template to reduce GC pressure and instantiation overhead
const statusBadgeTemplate = document.createElement('span');

function createStatusCellContent(progressState) {
if (!progressState.label) {
return createEmptyCell();
}
const badge = document.createElement('span');
const badge = statusBadgeTemplate.cloneNode(false);
badge.className = `status-badge ${progressState.className}`;
badge.textContent = progressState.label;
if (progressState.description) {
Expand Down
9 changes: 7 additions & 2 deletions cloud-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,13 @@ function openReportModal() {
// hand-edited files ever matter.
export function parseMsProjectXml(xml) {
const tag = (block, name) => {
const m = block.match(new RegExp(`<${name}>([^<]*)</${name}>`));
return m ? m[1].trim() : '';
const openTag = `<${name}>`;
const closeTag = `</${name}>`;
const start = block.indexOf(openTag);
if (start === -1) return '';
const end = block.indexOf(closeTag, start + openTag.length);
if (end === -1) return '';
return block.substring(start + openTag.length, end).trim();
};
const unescape = (s) => s
.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"')
Expand Down
Loading