Repair misheard words, surface cleanup failures, add a restart action

The cleanup prompt now asks the model to fix words the transcriber misheard
when the context makes the intended one clear, and to leave them alone when
it does not. Speech models fail phonetically on proper nouns, and that is
exactly what context can recover.

The names you enter for the transcription hint are handed to the cleanup
model as a glossary too. Knowing the spelling is what lets it recognise
"kuber netis" as Kubernetes.

A failed cleanup used to be almost invisible: the raw transcript was pasted
and a progress line flashed by, so a rejected key looked exactly like
working dictation for days. It now leaves the indicator amber with the
reason, sends a notification, and records the error in the history. HTTP
401, 402 and 429 are reported as what they are, naming the service.

Also:
- Settings can test the OpenRouter key, not just the OpenAI one
- Tray menu and CLI gained Restart, which re-execs in place
- Defaults saved into the config by older versions are recognised by their
  fingerprint and dropped, so an untouched prompt keeps getting improvements
- The IPC socket is user-only; Qt puts it in /tmp
This commit is contained in:
yusufipk
2026-07-25 19:51:32 +07:00
parent 011493a9bc
commit 60c8006725
9 changed files with 278 additions and 43 deletions
+19 -2
View File
@@ -20,8 +20,10 @@ REC = QColor(240, 78, 82)
BUSY = QColor(120, 170, 255)
OK = QColor(80, 205, 140)
ERR = QColor(240, 100, 90)
WARN = QColor(240, 180, 80)
STATE_COLORS = {"recording": REC, "busy": BUSY, "done": OK, "error": ERR}
STATE_COLORS = {"recording": REC, "busy": BUSY, "done": OK,
"warning": WARN, "error": ERR}
class Overlay(QWidget):
@@ -77,6 +79,13 @@ class Overlay(QWidget):
self._appear()
self._hide_timer.start(msec)
def show_warning(self, message, msec=9000):
"""Finished, but something the user should know about went wrong."""
self.state = "warning"
self.message = message
self._appear()
self._hide_timer.start(msec)
def show_error(self, message, msec=6000):
self.state = "error"
self.message = message
@@ -184,6 +193,14 @@ class Overlay(QWidget):
painter.drawPolyline(
QPointF(cx - 7, cy), QPointF(cx - 2, cy + 5.5), QPointF(cx + 7.5, cy - 6)
)
elif self.state == "warning":
pen = QPen(accent, 2.6)
pen.setCapStyle(Qt.PenCapStyle.RoundCap)
painter.setPen(pen)
painter.drawLine(QPointF(cx, cy - 7), QPointF(cx, cy + 1.5))
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(accent)
painter.drawEllipse(QPointF(cx, cy + 6), 1.5, 1.5)
else: # error
pen = QPen(accent, 2.4)
pen.setCapStyle(Qt.PenCapStyle.RoundCap)
@@ -222,7 +239,7 @@ class Overlay(QWidget):
def _draw_message(self, painter):
painter.setFont(self._label_font())
painter.setPen(TEXT if self.state != "error" else ERR)
painter.setPen({"error": ERR, "warning": WARN}.get(self.state, TEXT))
box = QRectF(46, 0, self.width() - 60, self.height())
metrics = QFontMetrics(self._label_font())
text = metrics.elidedText(self.message, Qt.TextElideMode.ElideRight, int(box.width()))