Week 4 of Building Pocketflow for Shipaton 2026: Storage, Push Alerts & Navigation
Pocketflow adds persistent media storage, completion alerts, remote asset recovery, and viewport controls for long-running AI workflows.
Week four of Pocketflow development for Shipaton 2026 focused on enhancing the app's robustness and navigability. The primary objectives included solving four key challenges: persistently storing media files on the device, alerting users through push notifications upon generation completion, preventing users from losing their way on the infinite Compose canvas, and caching cloud files locally to avoid blank asset screens post-login changes.
To address persistent storage concerns, raw bytes generated from images and videos were saved in a native documents directory using Kotlin Multiplatform platform-specific implementations. This approach avoided the risks associated with temporary directories, as the bytes were directly written to the documents directory with a unique file name based on the media type and a random UUID.
Cloud asset caching presented another challenge. When a user logged out and returned to the app with a new session, their local cache would be cleared, rendering the local file path invalid. To mitigate this, the UI was designed to automatically detect the remote cloud URL and, upon login, download the asset directly to the thumbnail renderer via Ktor HttpClient.
The code snippet checks if the path starts with an HTTP identifier, fetching the bytes from the cloud URL if it does and converting them to an image bitmap for display. If the path does not start with HTTP, the app falls back to loading the asset from the local directory and displaying it.
Push notifications were implemented using the OneSignal Framework for native iOS (Swift) and Android applications. The framework was integrated into a shared notification interface, and a simple alert was set up to notify users once a workflow had finished running successfully, encouraging them to view their newly generated assets.
Viewport centering was crucial for maintaining a balanced canvas workspace. When users panned too far, a Compass button was designed to re-center the canvas viewport by calculating the bounding box center of all workspace nodes. This formula ensured the canvas was repositioned around the screen center, preventing users from getting lost in the infinite canvas workspace. The code snippet calculates the center of the bounding box and adjusts the viewport's center accordingly.
With these enhancements in place, the app was deemed fully reliable. Moving forward, the next step would involve implementing customizable themes and activity audit logs to further improve the user experience and provide detailed tracking of app usage.
Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.