feat: discard button — removes email from queue without writing to score file
This commit is contained in:
parent
12248f4fab
commit
a75c363f8e
1 changed files with 11 additions and 1 deletions
|
|
@ -534,7 +534,7 @@ with tab_label:
|
||||||
|
|
||||||
# ── Navigation ────────────────────────────────────────────────────
|
# ── Navigation ────────────────────────────────────────────────────
|
||||||
st.markdown("")
|
st.markdown("")
|
||||||
nav_cols = st.columns([2, 1, 1])
|
nav_cols = st.columns([2, 1, 1, 1])
|
||||||
|
|
||||||
remaining = len(unlabeled) - 1
|
remaining = len(unlabeled) - 1
|
||||||
nav_cols[0].caption(f"**{remaining}** remaining · Keys: 1–9 = label, 0 = other, S = skip, U = undo")
|
nav_cols[0].caption(f"**{remaining}** remaining · Keys: 1–9 = label, 0 = other, S = skip, U = undo")
|
||||||
|
|
@ -556,6 +556,16 @@ with tab_label:
|
||||||
st.session_state.idx = next_idx
|
st.session_state.idx = next_idx
|
||||||
st.rerun()
|
st.rerun()
|
||||||
|
|
||||||
|
if nav_cols[3].button("🗑️ Discard", use_container_width=True):
|
||||||
|
# Remove from queue entirely — not written to score file
|
||||||
|
st.session_state.queue = [e for e in queue if _entry_key(e) != _entry_key(entry)]
|
||||||
|
_save_jsonl(_QUEUE_FILE, st.session_state.queue)
|
||||||
|
next_idx = min(idx, len(st.session_state.queue) - 1)
|
||||||
|
while next_idx < len(st.session_state.queue) and _entry_key(st.session_state.queue[next_idx]) in labeled_keys:
|
||||||
|
next_idx += 1
|
||||||
|
st.session_state.idx = max(next_idx, 0)
|
||||||
|
st.rerun()
|
||||||
|
|
||||||
# Keyboard shortcut capture (JS → hidden button click)
|
# Keyboard shortcut capture (JS → hidden button click)
|
||||||
st.components.v1.html(
|
st.components.v1.html(
|
||||||
"""<script>
|
"""<script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue