Skip to content

Fix recents open failures, viewer flicker/buffering, add fast-scroll UX - #14

Merged
Chethan616 merged 2 commits into
mainfrom
viewer-reliability-and-onboarding-polish
Sep 6, 2026
Merged

Chethan616 merged 2 commits into
mainfrom
viewer-reliability-and-onboarding-polish

Conversation

@Chethan616

@Chethan616 Chethan616 commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Recents: files opened via "Open with ClearPDF" from another app (WhatsApp, Gmail, ...) only carry a temporary read grant; once revoked, reopening from Recents failed with "Failed to open PDF" / "Couldn't read this spreadsheet." LocalDocumentMirror now saves a durable local copy the first time the file is readable and transparently falls back to it later.
  • PDF/PPT viewer flicker & "buffering": bitmap cache eviction ran on every scroll tick and on every render completion using an undebounced current-page value, recycling pages still transiting the viewport mid-scroll. Eviction is now one debounced sweep, cache radius increased, and pages ahead of/behind the scroll direction are prefetched proactively.
  • PPT last-page flicker: the empty-page placeholder assumed A4 portrait, collapsing ~2.5x on a landscape (converted .pptx) page and looping the last page in/out of the viewport.
  • xlsx viewer: dates now render correctly (was showing raw serials — xl/styles.xml wasn't read), hidden columns/rows are now honored like Excel, row-number gutter added, stacking fast-flick fling, and a WPS-style row scrubber with a compact liquid-glass "N/Total" badge. Per-cell border()+ripple replaced with one drawBehind() pass per row (this is what made the fling expose a stall on long sheets).
  • PPTX rendering: real slide renderer (PptxRenderer/OoxmlNode) — true slide size, shape geometry inherited from layout/master, theme colors, pictures, tables — replacing a converter that flattened every run of text into a portrait text dump.
  • DOCX rendering: DocxWebRenderer lays the document out with vendored docx-preview + JSZip (Apache-2.0/MIT, ~48KB total) in an offscreen WebView, rasterized via PrintDocumentAdapter with a public-API slice-render fallback; the original hand-written reflow stays as a last resort. Fully offline — no INTERNET permission declared.
  • Onboarding: brightened page 1's book content lines, added a progress-dot row + icon pop to page 4, replaced page 6's generic checkmark-in-a-circle with the same six-format color ring from page 1, and fixed GlassSearchHeader's bounce being springy on open but rigid on close.
  • Localization: added Spanish (es) — full translation, wired into both language pickers, LocaleHelper, and the locale allowlist.

Test plan

  • Open a PDF/xlsx via "Open with ClearPDF" from another app, wait, reopen from Recents — should still open.
  • Scroll a multi-page PDF and a converted .pptx quickly in both directions — no black flash / re-render stutter.
  • Open the xlsx sample with a date column and a hidden column — dates render, hidden column stays hidden.
  • Fast-flick the xlsx grid twice quickly in the same direction — scroll distance should stack.
  • Drag the new row-scrubber rail on a 500+ row sheet — small circular badge, live scroll.
  • Open a .docx and a .pptx — check layout fidelity against the old converter.
  • Switch language to Spanish in Settings and in first-run Onboarding.
  • Step through onboarding pages 1, 4, 6 for the visual changes; confirm page 5 is untouched.

Recents:
- LocalDocumentMirror durably copies a document the first time it is
  readable and transparently substitutes that copy once a share-intent
  URI's temporary grant is revoked, fixing "Failed to open PDF" /
  "Couldn't read this spreadsheet" when reopening from Recents.

PDF/PPT viewer:
- Bitmap cache eviction was running on every scroll tick (and again on
  every render completion) using an undebounced "current page", evicting
  pages still transiting the viewport mid-scroll and forcing them to
  re-render from scratch — this was the flicker/black-flash/"buffering".
  Eviction is now a single debounced sweep; the redundant per-render
  eviction is removed.
- Increased the bitmap cache radius and added directional prefetch
  (render a couple pages ahead of scroll direction) so a page is more
  often already rendered by the time it's reached in either direction.
- Fixed the empty-page placeholder assuming A4 portrait, which collapsed
  ~2.5x on a landscape (converted .pptx) page and could loop the last
  page in and out of the viewport.

Spreadsheet viewer:
- xlsx now reads xl/styles.xml so date cells render as dates instead of
  raw serials, and honors hidden columns/rows like Excel does. The PDF
  export path now shares this same parser instead of a second, drifted
  copy.
- Row-number gutter, pinned outside the horizontal scroll.
- Stacking fast-flick fling (repeated fast swipes carry further, up to
  4x, then hand off to the normal decay curve).
- WPS-style row scrubber rail with a small liquid-glass "N/Total" badge
  (sized like the search icon, not a wide labeled pill).
- Per-cell border()+ripple replaced with one drawBehind() grid-line pass
  per row and ripple-free taps — this is what made the fling above
  visible as "loads the next 100 rows after a pause" on long sheets.

PPTX viewer:
- Real slide renderer (PptxRenderer/OoxmlNode): true slide size, shape
  geometry inherited from layout/master, theme colors, embedded
  pictures, tables — replacing a converter that flattened every <a:t>
  into a portrait-A4 text dump.

DOCX viewer:
- DocxWebRenderer lays a .docx out with the vendored docx-preview +
  JSZip (Apache-2.0/MIT, ~48KB) in an offscreen WebView, then rasterizes
  it via the PrintDocumentAdapter path with a public-API slice-render
  fallback, keeping the original hand-written reflow as a last resort.
  Fully offline: the app declares no INTERNET permission.

Onboarding:
- Page 1: brightened the assembled book's later content lines (were a
  flat 0.62 alpha vs. 0.85 for the first line).
- Page 4: added a per-format progress-dot row and an icon pop on
  cross-fade.
- Page 6: replaced the generic checkmark-in-a-circle with the same
  six-format color ring from page 1, closing the loop the tour opened
  with instead of a stock "success" cliché.
- GlassSearchHeader's open/close bounce is now symmetric (both used
  morph(); close had regressed to a fully rigid settle()).

Localization:
- Added Spanish (es) — full strings.xml translation, wired into
  Settings/Onboarding language pickers, LocaleHelper, and the
  per-app-language locale allowlist.
@Chethan616
Chethan616 merged commit 29ea6ec into main Sep 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant