This repository has been archived on 2026-05-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
imagerepo/app/templates/_gallery_modal.html
T
bvandeusen 3f11dcdc6c fix(modal,tags): five UX follow-ups
1. Hide 'archive' kind from /tags default view. Archive tags only
   appear when the user explicitly requests them via ?kind=archive.
   _get_tags_with_previews gains a default_excluded_kinds tuple that
   applies when no explicit kind filter is set.

2. Hide the 'Add' submit button on desktop (>=768px). Enter in the
   tag input (and in the fandom picker when no row is highlighted)
   already submits; the button is only needed for mobile virtual
   keyboards where Enter-to-submit is unreliable.

3. Fandom picker keyboard parity: ArrowUp/Down navigate rows, Enter
   picks a highlighted row or (if no row is highlighted) submits the
   whole add-tag form. Escape clears the highlight. Mirrors the main
   tagInput's keyboard block.

4. Tag editor merge bug: the edit modal populated nameInput.value
   with data.tag.display_name — for a character with a fandom, that
   value is 'Name (Fandom)'. Saving without stripping the suffix
   routed to a rename that never collided with the canonical bare
   name, so the merge offer never fired. Now uses data.tag.name (the
   bare form). The (Fandom) display is still shown in the fandom
   input which is rendered separately.

5. Fandom picker styling: match the main tag-form input — same
   padding, border, background, focus state. Drop the separate
   'Fandom' label; the placeholder 'Fandom (optional)' now carries
   the label role.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 08:28:18 -04:00

91 lines
4.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- /app/templates/_gallery_modal.html -->
<div id="imageModal" class="modal">
<div class="modal-content">
<button id="modalClose" class="modal-close-btn" title="Close (ESC)">×</button>
<button id="modalPrev" class="modal-button modal-prev"></button>
<button id="modalNext" class="modal-button modal-next"></button>
<span class="modal-close-hint">ESC to close</span>
<div class="modal-body">
<div id="modalImageWrapper" class="modal-image-wrapper">
<img id="modalImage" src="" alt="Full View">
</div>
<div id="modalTagEditor" class="tag-editor modal-sidebar" data-image-id="">
<!-- SECTION: Series -->
<div class="modal-sidebar-section modal-series-section">
<!-- Shown when image IS in a series -->
<div id="modalSeriesInfo" class="modal-series-info" style="display: none;">
<div class="series-info-row">
<span class="series-info-label">📚</span>
<span class="series-info-label">Page</span>
<input type="number" id="modalPageNumber" min="1" class="series-page-input">
<span class="series-info-label">of</span>
<a id="modalSeriesName" href="#" class="series-info-link"></a>
<button id="updatePageBtn" class="btn-small" title="Update page number">Save</button>
<span id="pageUpdateStatus" class="tag-feedback"></span>
</div>
</div>
<!-- Shown when image is NOT in a series -->
<div id="modalAddToSeries" class="modal-add-to-series" style="display: none;">
<button id="addToSeriesToggle" class="modal-series-toggle">
<span>📚 Add to Series</span>
<span class="toggle-arrow"></span>
</button>
<div id="addToSeriesBody" class="add-series-body" style="display: none;">
<div class="add-series-controls">
<select id="seriesSelect" class="series-select">
<option value="">Select series...</option>
</select>
<input type="number" id="addSeriesPageNumber" min="1" value="1" class="series-page-input" placeholder="#">
<button id="addToSeriesBtn" class="btn-small" disabled>Add</button>
</div>
<span id="addToSeriesStatus" class="tag-feedback"></span>
</div>
</div>
</div>
<!-- SECTION: Provenance (system-generated tags: post; future: source, archive) -->
<div class="modal-sidebar-section modal-provenance-section" id="modalProvenanceSection" style="display: none;">
<div id="modalProvenanceList" class="provenance-list"></div>
</div>
<!-- SECTION: Tags -->
<div class="modal-sidebar-section modal-tags-section">
<div id="modalTagList" class="tags"></div>
<form id="modalTagForm" class="tag-form" autocomplete="off">
<div class="tag-form-wrapper">
<input type="text" id="tagInput" name="name" placeholder="Add tag..." autocomplete="off">
</div>
<button type="submit">Add</button>
</form>
<div id="fandomPickerWrapper" class="fandom-picker-wrapper" aria-hidden="true">
<div class="fandom-picker-input-row">
<input type="text" id="fandomPickerInput" class="fandom-picker-input"
placeholder="Fandom (optional)" autocomplete="off">
<button type="button" id="fandomPickerClear" class="btn-small"
aria-label="Clear fandom" title="Clear fandom">×</button>
</div>
<div id="fandomPickerAutocomplete"
class="tag-autocomplete tag-autocomplete-inline" aria-live="polite"></div>
</div>
<div id="tagAutocomplete" class="tag-autocomplete tag-autocomplete-inline" aria-live="polite"></div>
<span id="tagActionFeedback" class="tag-feedback tag-feedback-inline"></span>
</div>
<!-- SECTION: Suggestions (ML-backed, modal-only) -->
<div class="modal-sidebar-section modal-suggestions-section" id="modalSuggestionsSection" style="display: none;">
<div class="section-header">
<span class="section-title">Suggestions</span>
<button type="button" class="suggestions-refresh" id="suggestionsRefreshBtn" aria-label="Refresh suggestions"></button>
</div>
<div id="modalSuggestionsList" class="suggestions-list"></div>
</div>
</div>
</div>
</div>
</div>