Aller au contenu
login
arrow_backRetour aux issues
HafidIdrissi/Time-Tracker #18

browser_tab_title: suffix-only window title is not normalized to "(Untitled tab)"

ecoDébutant bug help wanted good first issue

descriptionDescription

In `timetracker/analytics.py`, `browser_tab_title()` calls `strip()` on the window title **before** comparing it against the known suffixes. Every entry in `BROWSER_SUFFIXES` starts with a space (for example `" - Google Chrome"`). As a result, a window title that consists of nothing but a suffix becomes `"- Google Chrome"` after `strip()`, no longer matches any entry, and is returned as-is instead of being normalized to `"(Untitled tab)"`. **Reproduction** ``` >>> browser_tab_title("chrome.exe", " - Google Chrome") '- Google Chrome' # expected: '(Untitled tab)' ``` **Background** Spotted while reviewing #10. A test case covering this situation was written, then removed in commit 3ca0980 to match the current behaviour rather than flagging it. The squash message for #10 still mentions "empty/suffix-only titles" even though the suffix-only case is not actually covered. **Decision needed** Either fix the normalization, or document this as acceptable behaviour. If we fix it, the test case should be restored.
codeOuvre sur GitHub