The RCWeb Gallery App (app/gallery) is an elegant peer-to-peer image sharing and viewing application. Based heavily on the Symmetric Pattern, it turns all connected web browsers in a room into a collective, decentralized photo gallery.


The logic in script.js extends the same rc.sendFileChunk core used by the Files app but specializes deeply in image processing.
width: 300). On the sender side, drawResizedImageToCanvas() intercepts the original binary File, paints it asynchronously to an offline HTML <canvas>, computes severe downsizing to match the requested resolution, and ships the resulting lightweight JPG payload via HTTP PUT back to the requester.HEART_BEAT_INTERVAL loop coordinates rc.client ping presence tracking. If a host browser goes dark (HEART_BEAT_INTERVAL_DISCONNECTED), thumbnails turn red with a visual countdown timer giving the host a grace period to reconnect before dropping the photos aggressively.#select-..., #open-large, #lightbox). Selecting photos dynamically pushes these UI states into the URL structure utilizing window.addEventListener("hashchange", ...) allowing rapid navigation and deep-link browser history support.taskQueue and resumeTasks() structure to prevent browsers from freezing when rendering dozens of heavy WebGL/Canvas resized frames in rapid succession.