|
1 | 1 | import { Observable, EventData, Page, SplitView, ItemEventData } from '@nativescript/core'; |
2 | | -import { getItemCallbacks } from './split-view-root'; |
| 2 | +import { SplitViewBrief, broadcastSelection } from './split-view-root'; |
| 3 | + |
3 | 4 | let page: Page; |
4 | 5 |
|
| 6 | +const briefData: SplitViewBrief[] = [ |
| 7 | + { |
| 8 | + id: 'brief-morning', |
| 9 | + title: 'Morning Briefing', |
| 10 | + category: 'Operations', |
| 11 | + status: 'Prep for leadership sync', |
| 12 | + summary: 'Snapshot of overnight metrics and open questions for the ops pod.', |
| 13 | + owner: 'Taylor Brooks', |
| 14 | + updated: 'Updated 9:41 AM', |
| 15 | + accent: '#0A84FF', |
| 16 | + tagline: 'Send digest to the exec channel by 11:00 AM.', |
| 17 | + notes: 'Pull final revenue numbers, plug in the refreshed engagement chart, and make sure automation stays enabled before the noon lock.', |
| 18 | + actions: ['Drop the updated charts into the keynote deck.', 'Verify Siri Shortcut triggers run on the new data set.', 'Line up quick talking points for the 11:00 AM call.'], |
| 19 | + highlights: [ |
| 20 | + { label: 'Focus', value: 'Engagement + device health' }, |
| 21 | + { label: 'Next Check-in', value: 'Ops sync at 2:30 PM' }, |
| 22 | + ], |
| 23 | + metrics: [ |
| 24 | + { label: 'Priority', value: 'High' }, |
| 25 | + { label: 'Delivery', value: 'Exec brief' }, |
| 26 | + { label: 'Attachments', value: '4 files' }, |
| 27 | + { label: 'Watchers', value: '6 people' }, |
| 28 | + ], |
| 29 | + contributors: ['Taylor', 'Morgan', 'Priya'], |
| 30 | + tags: ['Ops', 'Daily', 'Exec'], |
| 31 | + }, |
| 32 | + { |
| 33 | + id: 'brief-design', |
| 34 | + title: 'Split View polish', |
| 35 | + category: 'Design', |
| 36 | + status: 'Assets ready for QA', |
| 37 | + summary: 'Interaction audit for the compact-to-regular transition on iPadOS.', |
| 38 | + owner: 'Isla Raymond', |
| 39 | + updated: 'Updated 8:12 AM', |
| 40 | + accent: '#FF9F0A', |
| 41 | + tagline: 'Need sign-off from Brandon before handoff.', |
| 42 | + notes: 'Finalize the inspector column metrics cards and verify the peek gesture targets. Attach the quick recording from TestFlight build 4120.', |
| 43 | + actions: ['Export motion specs for the spring animation.', 'Confirm hit targets with accessibility review.', 'Share the color tokens with web once approved.'], |
| 44 | + highlights: [ |
| 45 | + { label: 'Focus', value: 'Regular width interactions' }, |
| 46 | + { label: 'Blocked by', value: 'Motion review @ 3:00 PM' }, |
| 47 | + ], |
| 48 | + metrics: [ |
| 49 | + { label: 'Priority', value: 'Medium' }, |
| 50 | + { label: 'Delivery', value: 'Design QA' }, |
| 51 | + { label: 'Attachments', value: '6 files' }, |
| 52 | + { label: 'Watchers', value: '4 people' }, |
| 53 | + ], |
| 54 | + contributors: ['Isla', 'Brandon', 'Nova'], |
| 55 | + tags: ['Design', 'QA'], |
| 56 | + }, |
| 57 | + { |
| 58 | + id: 'brief-field', |
| 59 | + title: 'Field research recap', |
| 60 | + category: 'Research', |
| 61 | + status: 'Synthesize recordings', |
| 62 | + summary: 'Notes from three in-store sessions about the new onboarding.', |
| 63 | + owner: 'Sam Park', |
| 64 | + updated: 'Updated yesterday', |
| 65 | + accent: '#32D74B', |
| 66 | + tagline: 'Clips already in the shared Photos album.', |
| 67 | + notes: 'Pull direct quotes for friction points around quick actions, and pair with the heat map captures for the appendix slide.', |
| 68 | + actions: ['Flag standout clips for the highlight reel.', 'Post the transcript summary in #research.', 'Open follow-up tasks for the onboarding squad.'], |
| 69 | + highlights: [ |
| 70 | + { label: 'Focus', value: 'Onboarding swipes' }, |
| 71 | + { label: 'Next Check-in', value: 'Squad sync Friday' }, |
| 72 | + ], |
| 73 | + metrics: [ |
| 74 | + { label: 'Priority', value: 'Medium' }, |
| 75 | + { label: 'Delivery', value: 'Research recap' }, |
| 76 | + { label: 'Attachments', value: '9 clips' }, |
| 77 | + { label: 'Watchers', value: '3 people' }, |
| 78 | + ], |
| 79 | + contributors: ['Sam', 'Kaia'], |
| 80 | + tags: ['Research', 'Clips', 'Onboarding'], |
| 81 | + }, |
| 82 | + { |
| 83 | + id: 'brief-gallery', |
| 84 | + title: 'Shortcuts gallery update', |
| 85 | + category: 'Product', |
| 86 | + status: 'Ready to publish', |
| 87 | + summary: 'Curated cards for the iPad productivity spotlight next week.', |
| 88 | + owner: 'Luca Nguyen', |
| 89 | + updated: 'Updated Monday', |
| 90 | + accent: '#BF5AF2', |
| 91 | + tagline: 'Publishing window opens Thursday morning.', |
| 92 | + notes: 'Verify icon treatments render crisply on mini + 12.9 screens, and double-check localized copy for DE/JA.', |
| 93 | + actions: ['Ping localization for the remaining strings.', 'Preview the curated set on device.', 'Coordinate push copy with marketing.'], |
| 94 | + highlights: [ |
| 95 | + { label: 'Focus', value: 'Automation + Productivity' }, |
| 96 | + { label: 'Blocked by', value: 'Awaiting DE copy' }, |
| 97 | + ], |
| 98 | + metrics: [ |
| 99 | + { label: 'Priority', value: 'High' }, |
| 100 | + { label: 'Delivery', value: 'App Store' }, |
| 101 | + { label: 'Attachments', value: '12 shortcuts' }, |
| 102 | + { label: 'Watchers', value: '5 people' }, |
| 103 | + ], |
| 104 | + contributors: ['Luca', 'Amelia', 'Jo'], |
| 105 | + tags: ['Launch', 'Localization'], |
| 106 | + }, |
| 107 | +]; |
| 108 | + |
5 | 109 | export function navigatingTo(args: EventData) { |
6 | 110 | page = <Page>args.object; |
7 | 111 | page.bindingContext = new SplitViewPrimaryModel(); |
8 | 112 | } |
9 | 113 |
|
10 | 114 | export class SplitViewPrimaryModel extends Observable { |
11 | | - items: string[] = []; |
| 115 | + briefs: SplitViewBrief[] = briefData; |
12 | 116 |
|
13 | 117 | constructor() { |
14 | 118 | super(); |
15 | | - this.items = Array.from({ length: 20 }, (_, i) => `Item ${i + 1}`); |
| 119 | + broadcastSelection(this.briefs[0]); |
16 | 120 | } |
17 | 121 |
|
18 | 122 | onItemTap(args: ItemEventData) { |
19 | | - console.log('args.index', args.index); |
| 123 | + const selectedBrief = this.briefs[args.index]; |
20 | 124 | SplitView.getInstance()?.showSecondary(); |
21 | | - getItemCallbacks().forEach((callback) => callback(this.items[args.index])); |
| 125 | + broadcastSelection(selectedBrief); |
22 | 126 | } |
23 | 127 | } |
0 commit comments