Skip to content

Commit e433886

Browse files
Improve library card performance and clean up display
- Add CSS contain: layout style to algo-cards to prevent cascading reflows - Switch library KaTeX to inline mode (cheaper to reflow on resize) - Remove "Equivalences" text from library cards Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b3810c7 commit e433886

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

webapp/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ body {
371371
background: #fff;
372372
border-radius: 8px;
373373
padding: 1.25rem;
374+
contain: layout style;
374375
border-left: 4px solid #4285f4;
375376
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
376377
cursor: pointer;

webapp/js/library-ui.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function renderLibraryCards(data) {
192192
try {
193193
katex.render(compLatex, tfMath, {
194194
throwOnError: false,
195-
displayMode: true,
195+
displayMode: false,
196196
});
197197
} catch (e) {
198198
tfMath.textContent = compLatex;
@@ -205,26 +205,6 @@ function renderLibraryCards(data) {
205205
card.appendChild(tfDiv);
206206
}
207207

208-
// Known equivalences
209-
const equivs = algo.equivalences || {};
210-
const equivEntries = [];
211-
if (equivs.oracle && equivs.oracle.length > 0) {
212-
equivEntries.push('oracle: ' + equivs.oracle.join(', '));
213-
}
214-
if (equivs.shift && equivs.shift.length > 0) {
215-
equivEntries.push('shift: ' + equivs.shift.join(', '));
216-
}
217-
if (equivs.lft && equivs.lft.length > 0) {
218-
const lftNames = equivs.lft.map(e => (typeof e === 'object' ? e.id : e));
219-
equivEntries.push('LFT: ' + lftNames.join(', '));
220-
}
221-
if (equivEntries.length > 0) {
222-
const equivDiv = document.createElement('div');
223-
equivDiv.style.cssText = 'margin-top:0.4rem;font-size:0.75rem;color:#888;';
224-
equivDiv.textContent = 'Equivalences: ' + equivEntries.join('; ');
225-
card.appendChild(equivDiv);
226-
}
227-
228208
grid.appendChild(card);
229209
}
230210
}

0 commit comments

Comments
 (0)