chore: close audit backlog — 6 polish fixes + docs#107
Merged
Conversation
The recents loop in viewer/panel.py called os.path.isfile(rp) which forces OneDrive Files-On-Demand placeholders to hydrate from the network at viewer startup. PR-G applied the same fix in i18n.py:290; this brings viewer/panel.py to parity. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d 2.0 The brand SVG/icon pixmap was hardcoded with setDevicePixelRatio(2.0), which assumes HiDPI and produces blurred rendering on standard 100%-scale monitors. Switch to self.devicePixelRatioF() with a defensive guard, matching the PR-J #4 PasswordDialog fix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
_convert_txt uses helv (Type-1 Latin-1) which renders any codepoint above U+00FF as a tofu glyph. Pre-scan a bounded 64 KB prefix of each source file and surface tool.warn.font_latin_only on the status bar, matching the existing PR-I L4 warning in page_numbers.py. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add a QLocale-backed helper so size displays (KB, font sizes) honour the system locale's decimal separator. DE/FR/IT/ES expect comma; EN/PT use period. Helper falls back to a plain f-string when QLocale fails, keeping headless test environments working. Apply at five callsites previously hardcoding ``:.1f``: - app/tools/compress.py (input size info) - app/tools/convert.py (input size info) - app/tools/info.py (two sites: details panel + status bar) - app/editor/dialogs.py (_TextEditDialog font-size label) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The schema example previously documented only 3 keys (dark_mode, language, recent_files) but the application reads 5 (adds tool_usage and max_recent_files). Replace the bare snippet with a structured table covering all keys, defaults, and platform path resolution (XDG vs legacy ~/.pdfapps_config.json). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Document the env vars PDFApps reads or writes, in three groups: - Standard platform vars (XDG_CONFIG_HOME, FLATPAK_ID, SNAP, APPIMAGE, APPDIR) used for sandbox detection and config path resolution. - PyInstaller internals (_PYI_* and _MEIPASS*) cleared by _restart_app to prevent stale-state contamination on relaunch. - TESSDATA_PREFIX override consumed by the OCR tool. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Nine assertions cover the six polish items: - viewer recents lexists swap - brand icon devicePixelRatioF scaling - import_pdf txt-to-pdf font_latin_only warning - format_size_localized helper + 5 callsite migration + QLocale fallback path - CONTRIBUTING.md config.json schema with 5 keys - CONTRIBUTING.md environment variables section Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
| ) | ||
| from app.i18n import t | ||
| from app.utils import error_color | ||
| from app.utils import error_color, format_size_localized |
|
|
||
| from pathlib import Path | ||
|
|
||
| import pytest |
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.
Summary
Final polish round to close the 11-round audit backlog. 4 code fixes + 2 docs updates. After merge, the 98 catalogued findings reach final state: 87 fixed in code, 4 remain as v1.14/v2 architectural roadmap items, 7 confirmed not-reproducible / already-fixed-implicitly / feature-gap.
Fixes
viewer/panel.py:338switched fromos.path.isfiletoos.path.lexistsso OneDrive Files-On-Demand placeholders don't hydrate on every viewer startup. Matches the PR-G fix ini18n.py:290.window.pybrand SVG icon was hardcoded to DPR=2.0 (assumed HiDPI). Now usesdevicePixelRatioF()for crisp rendering on any display scale. Same pattern as PR-J feat: add PDF search with Ctrl+F #4 (PasswordDialog).tools/import_pdf.py(txt-to-pdf path) now emits the sametool.warn.font_latin_onlystatus aspage_numbers.pywhen input contains characters outside Helvetica's Latin-1 range. Prevents silent tofu output.utils.format_size_localizedusesQLocale.system().toString()for size displays (KB, MB). Applied to 5 callsites in compress/convert/info/dialogs. DE/FR/IT users now see comma instead of period.Docs
CONTRIBUTING.mdschema table expanded withtool_usageandmax_recent_files(5 keys total). Path resolution clarified per platform (XDG vs legacy).XDG_CONFIG_HOME,FLATPAK_ID,SNAP,APPIMAGE,APPDIR), PyInstaller internals (_PYI_*,_MEIPASS*), and TesseractTESSDATA_PREFIX.Tests
tests/test_polish_close_audit.py— 9 tests (source-level + behavioral for format helper, fallback path coverage). All pass.What remains after this PR
QLocalServer) — HIGH UX value, slated for v1.14pdfapps://protocol handler — LOW value, skip until user request~/Library/Application Support/PDFApps/— HIG compliance, defer v2portalockercross-process config lock — bounded impact, defer v2Validation
APP_VERSIONbump