Skip to content

Commit 6ee699b

Browse files
neo-opus-adatobiu
andauthored
refactor(portal): promote canvas glue to shared Portal.view.content (#12206) (#12224)
Co-authored-by: tobiu <tobiasuhlig78@gmail.com>
1 parent f75eb6f commit 6ee699b

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

apps/portal/view/news/tickets/CanvasWrapper.mjs renamed to apps/portal/view/content/CanvasWrapper.mjs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
import Container from '../../../../../src/container/Base.mjs';
2-
import ContentComponent from './Component.mjs';
3-
import TimelineCanvas from './TimelineCanvas.mjs';
1+
import Container from '../../../../../src/container/Base.mjs';
2+
import TimelineCanvas from './TimelineCanvas.mjs';
43

54
/**
6-
* @class Portal.view.news.tickets.CanvasWrapper
5+
* @class Portal.view.content.CanvasWrapper
76
* @extends Neo.container.Base
87
*/
98
class CanvasWrapper extends Container {
109
static config = {
1110
/**
12-
* @member {String} className='Portal.view.news.tickets.CanvasWrapper'
11+
* @member {String} className='Portal.view.content.CanvasWrapper'
1312
* @protected
1413
*/
15-
className: 'Portal.view.news.tickets.CanvasWrapper',
14+
className: 'Portal.view.content.CanvasWrapper',
1615
/**
1716
* @member {String[]} cls=['portal-canvas-wrapper']
1817
*/
1918
cls: ['portal-canvas-wrapper'],
2019
/**
21-
* @member {Neo.component.Base|null} contentComponent=ContentComponent
20+
* @member {Neo.component.Base|null} contentComponent=null
2221
*/
23-
contentComponent: ContentComponent,
22+
contentComponent: null,
2423
/**
2524
* @member {Object} layout=null
2625
*/

apps/portal/view/news/tickets/TimelineCanvas.mjs renamed to apps/portal/view/content/TimelineCanvas.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import SharedCanvas from '../../../../../src/app/SharedCanvas.mjs';
33
/**
44
* @summary The "Coordinator" component for the Neural Timeline, bridging the App Worker and Canvas Worker.
55
*
6-
* This component renders a transparent canvas overlay on top of the Ticket List. It is responsible for:
7-
* 1. **Data Bridge**: Listening to the `sections` store and passing ticket data to the `TimelineCanvas` (SharedWorker).
6+
* This component renders a transparent canvas overlay on top of the content list. It is responsible for:
7+
* 1. **Data Bridge**: Listening to the `sections` store and passing record data to the `TimelineCanvas` (SharedWorker).
88
* 2. **Visual Alignment**: Calculating the precise DOM positions of Ticket Avatars/Badges to ensure the
99
* canvas nodes align perfectly with the HTML content.
1010
* 3. **Lifecycle Management**: initializing the offscreen canvas transfer and handling resize events.
1111
*
1212
* It uses the `Portal.canvas.TimelineCanvas` singleton (via Remote Method Access) to drive the actual animation.
1313
*
14-
* @class Portal.view.news.tickets.TimelineCanvas
14+
* @class Portal.view.content.TimelineCanvas
1515
* @extends Neo.app.SharedCanvas
1616
*/
1717
class TimelineCanvas extends SharedCanvas {
@@ -27,10 +27,10 @@ class TimelineCanvas extends SharedCanvas {
2727

2828
static config = {
2929
/**
30-
* @member {String} className='Portal.view.news.tickets.TimelineCanvas'
30+
* @member {String} className='Portal.view.content.TimelineCanvas'
3131
* @protected
3232
*/
33-
className: 'Portal.view.news.tickets.TimelineCanvas',
33+
className: 'Portal.view.content.TimelineCanvas',
3434
/**
3535
* @member {String} rendererClassName='Portal.canvas.TimelineCanvas'
3636
*/
@@ -43,7 +43,7 @@ class TimelineCanvas extends SharedCanvas {
4343
* @member {Object} _vdom
4444
*/
4545
_vdom:
46-
{tag: 'div', cls: ['neo-ticket-timeline-wrapper'], style: {width: '100%', height: '100%'}, cn: [
46+
{tag: 'div', cls: ['neo-timeline-wrapper'], style: {width: '100%', height: '100%'}, cn: [
4747
{tag: 'canvas', style: {width: '100%', height: '100%'}}
4848
]}
4949
}
@@ -143,7 +143,7 @@ class TimelineCanvas extends SharedCanvas {
143143
* This method synchronizes the Canvas nodes with the DOM elements (Avatars/Badges).
144144
*
145145
* **Strategy:**
146-
* 1. **Targeting**: It uses the `-target` ID suffix to find the specific DOM elements (Avatars) within the ticket list.
146+
* 1. **Targeting**: It uses the `-target` ID suffix to find the specific DOM elements (Avatars) within the content list.
147147
* 2. **Measurement**: It fetches the `DOMRect` for every target to get its exact screen position.
148148
* 3. **Translation**: It converts these screen coordinates into Canvas-local coordinates.
149149
* 4. **Handoff**: It packages this geometric data (x, y, radius, color) and sends it to the

apps/portal/view/news/tickets/MainContainer.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import CanvasWrapper from './CanvasWrapper.mjs';
1+
import CanvasWrapper from '../../content/CanvasWrapper.mjs';
2+
import Component from './Component.mjs';
23
import Controller from './MainContainerController.mjs';
34
import PageContainer from './PageContainer.mjs';
45
import SharedContainer from '../../../../../src/app/content/Container.mjs';
@@ -32,7 +33,8 @@ class MainContainer extends SharedContainer {
3233
module : PageContainer,
3334
buttonTextField: 'id',
3435
contentConfig : {
35-
module: CanvasWrapper
36+
contentComponent: Component,
37+
module : CanvasWrapper
3638
}
3739
},
3840
/**

0 commit comments

Comments
 (0)