fix: remove dead code, ship Fill Forms as a live tool, harden form filling - #126
Conversation
- Deleted the unused `HomeScreen.kt` which had grown orphaned. - Added the `fill_forms` tool entry back into the correct, live UI (`ToolsScreen.kt`). - Localized the internal strings for `FillFormsScreen.kt`. - Handled empty forms and read-only forms with new validation states. - Handled malformed form fields in `PdfFormFiller` by safely throwing and catching, saving them as `UnknownField`. - Identified and ignored `PDSignatureField` types explicitly to avoid crashes. - Added robust unit test coverage. - Maintained `PdfRedactor.kt` since it represents completed logic for a possible future tool (decision deferred to reviewer). Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Deleted the unused `HomeScreen.kt` which had grown orphaned. - Added the `fill_forms` tool entry back into the correct, live UI (`ToolsScreen.kt`). - Localized the internal strings for `FillFormsScreen.kt`. - Handled empty forms and read-only forms with new validation states. - Handled malformed form fields in `PdfFormFiller` by safely throwing and catching, saving them as `UnknownField`. - Identified and ignored `PDSignatureField` types explicitly to avoid crashes. - Added robust unit test coverage. - Maintained `PdfRedactor.kt` since it represents completed logic for a possible future tool (decision deferred to reviewer). Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…17965486998119656232-6553282119786126740 fix: translate fill forms strings across all locales
Problem Statement
This PR addresses the dead code audit findings and fixes the orphaned "Fill Forms" feature per the provided specification.
HomeScreen.ktwas 100% orphaned.ToolsScreen.kt.Changes Made
Part A - Dead Code Cleanup
HomeScreen.kt: A fullgrepsweep confirmed zero references toHomeScreen(,ToolCategory, or its localized titles anywhere in the active navigation tree (AppNavigation.ktandScreen.kt).PdfRedactor.kt: After confirming zero references in theui/layer or README, I've left it intact for human review, as it is a fully implemented domain class underdomain/operations/and could be a parked/future feature, not just a duplicate view likeHomeScreen.kt. (I have not modified it).ui/screens/revealedLanguageSelectionScreen,MultiOutputResultScreenandPdfViewerViewModelare unreferenced inAppNavigation.kt. However, this is expected behavior for inner components/view models, so they have been left untouched.Part B - Wired Fill Forms
fill_formstool entry toToolsScreen.ktunder theToolSection.SECURITYblock using the existing string keystool_fill_forms/desc_fill_formsand theIcons.Default.EditNoteicon. Confirmed routing maps correctly (Screen.FillForms).Part C - Fill Forms Hardening
strings.xmland wired them up inFillFormsScreen.ktusingstringResource().state.fillableFields == 0(e.g., when a form has fields but all of them are marked read-only).try/catchinsidePdfFormFiller.kt, continuing the processing instead of crashing the analyzer.PDSignatureFieldto ensure they default to anUnknownFieldflagged as "Signature", skipping crashes.PdfFormFillerTest.ktunit tests verifying the fallback logic against a real, mockPDDocumentstructure (eschewing Robolectric PDFBox asset bugs). Added basic state transition coverage toFillFormsScreenTest.kt.All tests pass on all 3 flavors (
fdroid,opensource, andplaystore). No new test regressions were introduced.PR created automatically by Jules for task 17965486998119656232 started by @Karna14314