Skip to content

auth dialog: show a live countdown instead of a static "auto-denies in 2m" #433

Description

@fu351

The dialog's message ends with deadline_note(DEFAULT_DIALOG_TIMEOUT_S) ("auto-denies in 2m if unanswered"), appended once when the segments are built (src/doberman/auth/gui_prompter.py:240). The auto-deny itself is a single root.after(int(timeout_s * 1000), root.quit) (:526). A human who walks back with ten seconds left still reads "2m".

What to do

  1. Keep the auto-deny exactly as it is. This issue only changes what the deadline line says.
  2. Render the deadline segment so it can be updated in place (tag the range in the Text widget, or draw it as its own canvas text item), then add a _tick() that recomputes the remaining seconds from the dialog's start time and rewrites that segment every second via root.after(1000, _tick). Stop ticking when the root is destroyed.
  3. Format the text with the existing deadline_note helper if it accepts seconds, otherwise a plain auto-denies in 45s if unanswered. Keep it muted like today.
  4. Test in tests/unit/test_gui_prompter.py with the faked root: two simulated ticks change the deadline text, and the after that arms the auto-deny is still scheduled exactly once with the same delay.

The timeout value and the deny-on-timeout behaviour stay untouched; a test pinning that already exists and must stay green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first challengeNext step after good first issue - more scope or contract depth, still self-containedlevel-3Write a self-contained test, or add a flag following an existing sibling pattern.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions