You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/email/EPIC_PLAN.md
+38-11Lines changed: 38 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,28 +25,55 @@ This document outlines the plan for refactoring the `apps/email` application int
25
25
26
26
---
27
27
28
-
## Phase 2: Email List View
28
+
## Phase 2: Email List View (Completed)
29
29
30
30
**Goal:** Implement the email list pane using a Neo.mjs grid to display a list of emails.
31
31
32
-
**Potential Tools to Explore:**
32
+
**Sub-Tasks:**
33
33
34
-
-`src/grid/Base.mjs`: For a powerful, feature-rich data grid.
35
-
-`src/list/Base.mjs`: For a simpler list view if a full grid is not needed initially.
36
-
-`src/data/Store.mjs`: To manage the email data.
37
-
-`src/collection/Base.mjs`: For sorting and filtering capabilities within the store.
34
+
1.**Create Mock Data:**
35
+
- Populated the `apps/email/store/Emails.mjs` with hardcoded sample email data.
36
+
2.**Integrate Grid:**
37
+
- Replaced the "Email List" placeholder in `MainView.mjs` with a `Neo.grid.Container`.
38
+
- Configured the grid to use the `Emails` store and defined the columns.
39
+
3.**Styling & Layout:**
40
+
- Wrapped the grid in a styled `div` to ensure correct flexbox layout.
41
+
- Used the `wrapperStyle` config on the grid to control its internal dimensions, which is necessary for the grid's layout engine.
42
+
4.**Enable Interoperability:**
43
+
- Enhanced `functional.component.Base` to propagate the parent's `windowId` to all child components. This was a critical fix to ensure the classic grid component could function correctly when rendered inside our functional `MainView`.
44
+
45
+
**Learnings & Decisions:**
46
+
47
+
-**Complex Component Integration:** Integrating a complex classic component like `grid.Container` into a functional component requires more than just placing it in the VDOM. We must provide layout-critical styles (like `height` and `width`) via the component's specific config (`wrapperStyle`) for it to render correctly.
48
+
-**`windowId` is Crucial:** The `windowId` must be manually propagated from functional parents to classic children. This is a fundamental requirement for interoperability and ensuring that events, theming, and other window-specific functionalities work correctly. This led to enhancing `functional.component.Base` and creating a dedicated ticket for it.
49
+
50
+
**Next Steps:**
51
+
- Implement selection handling on the grid to prepare for the detail view.
38
52
39
-
**Sub-Tasks:**
40
-
*(To be defined)*
41
53
42
54
---
43
55
44
-
## Phase 3: Email Detail View
56
+
## Phase 3: Email Detail View (Completed)
45
57
46
-
**Goal:** Display the content of a selected email.
58
+
**Goal:** Display the content of a selected email from the grid.
47
59
48
60
**Sub-Tasks:**
49
-
*(To be defined)*
61
+
62
+
1.**Grid Selection:**
63
+
- Configured a `selection.RowModel` on the grid's `bodyConfig`.
64
+
- Set `singleSelect: true` to allow only one row to be selected.
65
+
2.**State Management:**
66
+
- Used the `useConfig()` hook in `MainView` to create a `selectedEmail` state variable.
67
+
3.**Event Handling:**
68
+
- Added a `selectionChange` listener to the selection model.
69
+
- The listener updates the `selectedEmail` state with the selected record.
70
+
4.**Detail View:**
71
+
- The "Email Details" pane now conditionally renders the `title`, `sender`, and `content` of the `selectedEmail`.
72
+
- If no email is selected, it displays a placeholder message.
Copy file name to clipboardExpand all lines: apps/email/store/Emails.mjs
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,17 @@ class Emails extends Store {
15
15
/**
16
16
* @member {Neo.data.Model} model=Email
17
17
*/
18
-
model: EmailModel
18
+
model: EmailModel,
19
+
/**
20
+
* @member {Object[]} data
21
+
*/
22
+
data: [
23
+
{id: 1,sender: 'John Doe',title: 'Hello World!',content: 'This is the first email.',dateSent: '2025-07-15T10:00:00Z'},
24
+
{id: 2,sender: 'Jane Smith',title: 'Re: Project Update',content: 'Here is the project update you requested.',dateSent: '2025-07-15T11:30:00Z'},
25
+
{id: 3,sender: 'Peter Jones',title: 'Lunch tomorrow?',content: 'Are we still on for lunch tomorrow at 12:30?',dateSent: '2025-07-15T12:15:00Z'},
26
+
{id: 4,sender: 'Mary Williams',title: 'Your order has shipped',content: 'Your order #12345 has shipped and will arrive in 3-5 business days.',dateSent: '2025-07-14T15:45:00Z'},
27
+
{id: 5,sender: 'David Brown',title: 'Quick question',content: 'I have a quick question about the new feature.',dateSent: '2025-07-14T09:20:00Z'}
0 commit comments