mobile fixes

This commit is contained in:
2026-06-12 19:49:16 -07:00
parent 53487087a2
commit 99388b6487
2 changed files with 67 additions and 18 deletions

View File

@@ -1729,13 +1729,17 @@ function createFavoriteManagerRow(item, index) {
edit.type = 'button';
edit.className = 'secondary-button favorite-action';
edit.dataset.editFavorite = String(index);
edit.textContent = 'Edit';
edit.setAttribute('aria-label', `Edit ${item.title}`);
edit.title = 'Edit';
edit.append(createFavoriteActionIcon('edit'));
const remove = document.createElement('button');
remove.type = 'button';
remove.className = 'remove-favorite favorite-action';
remove.dataset.removeFavorite = String(index);
remove.textContent = 'Remove';
remove.setAttribute('aria-label', `Remove ${item.title}`);
remove.title = 'Remove';
remove.append(createFavoriteActionIcon('remove'));
const actions = document.createElement('div');
actions.className = 'favorite-actions';
@@ -1746,6 +1750,26 @@ function createFavoriteManagerRow(item, index) {
return row;
}
function createFavoriteActionIcon(kind) {
const namespace = 'http://www.w3.org/2000/svg';
const svg = document.createElementNS(namespace, 'svg');
const paths = kind === 'edit'
? ['M12 20h9', 'M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z']
: ['M3 6h18', 'M8 6V4h8v2', 'M6 6l1 15h10l1-15', 'M10 11v6', 'M14 11v6'];
svg.setAttribute('viewBox', '0 0 24 24');
svg.setAttribute('aria-hidden', 'true');
svg.setAttribute('focusable', 'false');
for (const pathData of paths) {
const path = document.createElementNS(namespace, 'path');
path.setAttribute('d', pathData);
svg.append(path);
}
return svg;
}
function startFavoriteWizard(mode, index = -1) {
const item = mode === 'edit' ? state.favorites[index] : null;