Frontmatter
| id | 8791 |
| title | Create Portal.canvas.Base to standardize Canvas Workers |
| state | Closed |
| labels | airefactoringarchitecture |
| assignees | tobiu |
| createdAt | Jan 19, 2026, 1:17 AM |
| updatedAt | Jan 19, 2026, 1:44 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8791 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 19, 2026, 1:44 AM |
Create Portal.canvas.Base to standardize Canvas Workers
tobiu assigned to @tobiu on Jan 19, 2026, 1:43 AM

tobiu
Jan 19, 2026, 1:43 AM
Input from Gemini 3 Pro:
✦ I have successfully created
Portal.canvas.Baseand refactored all four Portal canvases to extend it.Architectural Changes:
- Centralized Logic:
initGraph,clearGraph,updateSize,setTheme, andrenderLoopare now defined inPortal.canvas.Base.- Standardized Initialization: The base
initGraphimplements the robust polling mechanism and the critical!me.animationIdguard to prevent duplicate render loops.- Hook System: Introduced
onGraphMounted(width, height)hook in the base class, whichHeaderCanvas,HomeCanvas, andServicesCanvasuse to initialize their specific resources (particles, nodes) after the context is ready.- Reactive Theme: The
theme_config inBaseis reactive, ensuringafterSetThemeis triggered correctly. It callsupdateResourcesif the subclass implements it.- Singleton Inheritance Fix: Ensured
singleton: trueis defined in the subclasses (HeaderCanvas,HomeCanvas,ServicesCanvas,TicketCanvas) rather than the base class to allow proper extension.- Cleanup: Removed redundant method definitions and class fields from all four subclasses.
ServicesCanvasandHomeCanvascorrectly overrideupdateSizeto handle their specific scaling logic (includingme.scalecalculation and buffer resets), whileHeaderCanvasandTicketCanvasrely on the base implementation.Files Created/Modified:
apps/portal/canvas/Base.mjs(New)apps/portal/canvas/HeaderCanvas.mjsapps/portal/canvas/HomeCanvas.mjsapps/portal/canvas/ServicesCanvas.mjsapps/portal/canvas/TicketCanvas.mjs
tobiu closed this issue on Jan 19, 2026, 1:44 AM
Create a
Portal.canvas.Baseclass to abstract common logic for the four Portal canvases (HeaderCanvas,HomeCanvas,ServicesCanvas,TicketCanvas).Goals:
initGraph: Implement the polling logic and the!me.animationIdguard in the base class.updateSize: Centralize the canvas resizing logic.theme_config in the base class to ensureafterSetTheme(and resource updates) are triggered correctly for all canvases.Target Files:
apps/portal/canvas/Base.mjs(New)apps/portal/canvas/HeaderCanvas.mjsapps/portal/canvas/HomeCanvas.mjsapps/portal/canvas/ServicesCanvas.mjsapps/portal/canvas/TicketCanvas.mjs