feat: compose signature with robust DE+EN placeholder handling (Paket I-3) - #25
Merged
Conversation
Signature insertion did not reliably replace AI placeholders. The previous pattern only matched [Ihr/Dein Name], so English placeholders ([Your Name]) and Vorname variants were left in place while the signature was appended a second time below them. - Add precompiled SIGNATURE_PLACEHOLDER_PATTERN covering curated DE+EN placeholders ([Name], [Ihr/Dein/Mein Name], [Vorname], [Vorname Nachname], [Nachname], [Absender], [Your/My/Full Name], [Unterschrift], [Signature]) plus an optional trailing comma; unrelated brackets stay untouched. - Use subn() so the signature is either substituted or appended, never both. - Strip trailing whitespace from the saved signature; keep _sync_state and _append_signature consistent so the button disables correctly. - Add 7 placeholder tests (logic was previously untested).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Übersicht
Paket I-3 der UX-/Compose-Roadmap: konfigurierbare Signatur im Compose-Fenster
plus ein Robustheits-Fix, nachdem das Einfügen in der Praxis nicht zuverlässig
funktionierte.
Bündelt zwei Commits:
c9ee689— Basis-Feature „Compose-Signatur"e73a5cc— Fix: robuste Platzhalter-BehandlungFeature (c9ee689)
config.compose_signature_text+compose_signature_auto_append(persistiert, validiert)btnSignatureim Compose-Fenster: manuelles Anhängen + optionales Auto-Append nach jeder KI-GenerierungFix (e73a5cc)
Vorher: Platzhalter-Regex matchte nur
[Ihr/Dein Name]. Englische Platzhalter(
[Your Name]) und[Vorname]-Varianten blieben stehen und die Signatur wurdezusätzlich unten angehängt (Doppel-Signatur). Die Platzhalter-Logik war ungetestet.
SIGNATURE_PLACEHOLDER_PATTERN, kuratiert DE + EN:[Name],[Ihr/Dein/Mein Name],[Vorname],[Vorname Nachname],[Nachname],[Absender],[Your/My/Full Name],[Unterschrift],[Signature]+ optionales Komma.Unbeteiligte Klammern (
[Anhang],[Datum],[Name des Projekts]) bleiben unberührt.subn()stattsub: ersetzt oder hängt an, nie beides → keine Doppel-Signatur.rstrip()-bereinigt (gegen versehentlich gespeicherte Zeilenumbrüche/Tabs)._sync_stateund_append_signaturekonsistent → Button deaktiviert korrekt.Tests
_sync_state()ergänzt.Test Plan
QT_QPA_PLATFORM=offscreen WHISPER_GUI_TESTS=1 python -m pytest -q→ 347 passed[Ihr Name]/[Your Name]→ Signatur ersetzt Platzhalter ohne hängendes Komma