@trackunit/iris-app 1.7.28 → 1.7.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 1.7.30 (2025-10-15)
2
+
3
+ This was a version bump only for iris-app to align it with other projects, there were no code changes.
4
+
5
+ ## 1.7.29 (2025-10-15)
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated iris-app-build-utilities to 1.7.28
10
+ - Updated iris-app-webpack-plugin to 1.7.29
11
+ - Updated iris-app-api to 1.7.28
12
+ - Updated react-test-setup to 1.4.27
13
+ - Updated shared-utils to 1.9.27
14
+
1
15
  ## 1.7.28 (2025-10-10)
2
16
 
3
17
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app",
3
- "version": "1.7.28",
3
+ "version": "1.7.30",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "main": "src/index.js",
6
6
  "generators": "./generators.json",
@@ -32,12 +32,12 @@
32
32
  "@npmcli/arborist": "^7.3.1",
33
33
  "webpack-bundle-analyzer": "^4.8.0",
34
34
  "win-ca": "^3.5.1",
35
- "@trackunit/iris-app-build-utilities": "1.7.27",
36
- "@trackunit/shared-utils": "1.9.26",
37
- "@trackunit/iris-app-api": "1.7.27",
38
- "@trackunit/iris-app-webpack-plugin": "1.7.28",
35
+ "@trackunit/iris-app-build-utilities": "1.7.28",
36
+ "@trackunit/shared-utils": "1.9.27",
37
+ "@trackunit/iris-app-api": "1.7.28",
38
+ "@trackunit/iris-app-webpack-plugin": "1.7.29",
39
39
  "tslib": "^2.6.2",
40
- "@trackunit/react-test-setup": "1.4.26"
40
+ "@trackunit/react-test-setup": "1.4.27"
41
41
  },
42
42
  "types": "./src/index.d.ts",
43
43
  "type": "commonjs"
@@ -0,0 +1,226 @@
1
+ # Create IrisX App
2
+
3
+ You are helping a user create a new IrisX App with appropriate extensions. Follow this browser-driven iterative development workflow.
4
+
5
+ ## Core Principles
6
+
7
+ ### Real Data First
8
+ **CRITICAL: Always use Trackunit's GraphQL API for data** - never mock data unless explicitly requested.
9
+ - Use **Trackunit MCP** `introspect-schema` to discover available data
10
+ - Use **Trackunit MCP** `validate-query` to test queries before implementing
11
+ - See @irisx-app-sdk-graphql for implementation patterns
12
+
13
+ ### UI Components
14
+ **Use Trackunit Component Library** for consistent UI:
15
+ - Use **Trackunit MCP** `get-story-code` to find components and patterns
16
+ - See @tables-and-sorting, @react-core-hooks for details
17
+
18
+ ### Browser Testing
19
+ **Follow browser-first development workflow**:
20
+ - See @browser-irisx-development for complete browser testing procedures
21
+ - Always verify in browser after each code change
22
+ - Check lints first, then reload browser and verify
23
+
24
+ ## Development Workflow
25
+
26
+ ### Phase 1: Planning
27
+
28
+ **1. Analyze Requirements**
29
+ If not already described, ask: "What functionality do you want to build?"
30
+
31
+ **2. Create Implementation Plan**
32
+ Before any coding, create a detailed plan that **MUST follow this structure**:
33
+
34
+ **Phase 1: Project Setup**
35
+ - Create app with `@trackunit/iris-app:create [app-name]`
36
+ - Create extensions with `@trackunit/iris-app:extend` (list each extension)
37
+ - Start dev server in background
38
+
39
+ **Phase 2: Browser Verification (CRITICAL GATE)**
40
+ - Open browser to https://new.manager.trackunit.com/goto/iris-app-dev
41
+ - Wait for user login (2-4 minutes)
42
+ - Enable "Use Local Apps" toggle if not already enabled
43
+ - Navigate to extension location based on type (see @browser-irisx-development):
44
+ - FLEET_EXTENSION: Main menu → App name
45
+ - ASSET_HOME_EXTENSION: Assets → Select asset → Extension tab
46
+ - SITE_HOME_EXTENSION: Sites → Select site → Extension tab
47
+ - WIDGET_EXTENSION: Dashboard → Add Widget → Find widget
48
+ - Take snapshot to verify extension loads
49
+ - Check console for errors
50
+ - **STOP - Must confirm extension working in browser before Phase 3**
51
+
52
+ **Phase 3: Feature Implementation (One at a Time)**
53
+ For EACH feature, list as separate item:
54
+ - Feature 1: [Name]
55
+ - Prerequisites: [GraphQL setup/scopes/packages needed for THIS feature only]
56
+ - Implementation: [What to build]
57
+ - Validation: Check lints (zero tolerance), then browser test
58
+ - Browser test: [What to verify]
59
+
60
+ - Feature 2: [Name]
61
+ - Prerequisites: [Any new tools needed for THIS feature]
62
+ - Implementation: [What to build]
63
+ - Validation: Check lints (zero tolerance), then browser test
64
+ - Browser test: [What to verify]
65
+
66
+ (Continue for all features)
67
+
68
+ **Phase 4: Final Verification**
69
+ - Run lints on all files (zero errors)
70
+ - End-to-end browser testing
71
+ - Documentation completion
72
+
73
+ **Plan Details:**
74
+ - App name: [kebab-case, descriptive]
75
+ - Extension types: [List types from @irisx-app-sdk]
76
+ - Data sources: [GraphQL queries, CustomFields needed]
77
+ - UI components: [Components from Trackunit library]
78
+ - Manifest config: [Scopes, CSP headers if needed]
79
+
80
+ **3. Present Plan to User**
81
+ Show the complete plan with:
82
+ - **Browser flow explicitly documented** in Phase 2 with the URL https://new.manager.trackunit.com/goto/iris-app-dev
83
+ - Navigation steps for the specific extension type(s)
84
+ - Browser-first workflow clearly outlined
85
+ Confirm with user before proceeding.
86
+
87
+ ### Phase 2: Project Setup
88
+
89
+ **4. Create App and Extensions ONLY**
90
+ ```bash
91
+ npx nx generate @trackunit/iris-app:create [app-name]
92
+ npx nx g @trackunit/iris-app:extend --name=[extension-name] --directory=[feature-name] --type=[EXTENSION_TYPE]
93
+ ```
94
+
95
+ **5. Start Development Server Immediately**
96
+ Run in background terminal right after creation:
97
+ ```bash
98
+ npx nx run [app-name]:serve
99
+ ```
100
+
101
+ **6. Open Browser and Verify Basics Work**
102
+ **CRITICAL: Do this BEFORE any GraphQL setup or UI implementation**
103
+
104
+ Follow the complete browser setup workflow in @browser-irisx-development:
105
+ - Navigate to https://new.manager.trackunit.com/goto/iris-app-dev (NEVER localhost!)
106
+ - Wait for user login (be patient, 2-4 minutes)
107
+ - Enable "Use Local Apps" toggle in sidebar if not already enabled
108
+ - Navigate to extension location based on type:
109
+ - FLEET_EXTENSION: Main menu → Look for app name
110
+ - ASSET_HOME_EXTENSION: Assets → Open any asset → Look for extension tab
111
+ - SITE_HOME_EXTENSION: Sites → Open any site → Look for extension tab
112
+ - WIDGET_EXTENSION: Dashboard → Add Widget → Find widget
113
+ - Take snapshot to verify extension loads
114
+ - Check console for errors using browser_console_messages
115
+
116
+ **STOP HERE: Do not proceed to Phase 3 until extension is confirmed working in browser**
117
+
118
+ ### Phase 3: Iterative Feature Development
119
+
120
+ **7. Create Documentation**
121
+ Create `/docs/[app-name].md` following @structured-development with the plan and architecture.
122
+
123
+ **8. For Each Feature in Plan (ONE AT A TIME)**
124
+
125
+ For each feature, follow this exact workflow:
126
+
127
+ **a) Setup prerequisites for this feature ONLY**:
128
+ - If feature needs GraphQL: Install GraphQL tools NOW
129
+ ```bash
130
+ npm install @trackunit/react-graphql-tools
131
+ npx nx generate @trackunit/react-graphql-tools:add-graphql --project=[project-name]
132
+ ```
133
+ - If feature needs specific scopes: Update manifest NOW
134
+ - If feature needs CustomFields: Configure manifest NOW
135
+ - Use Trackunit MCP to discover data/components needed for THIS feature
136
+
137
+ **b) Implement the feature**:
138
+ - Write code changes for ONE feature only
139
+ - Keep changes small and focused (single metric, single UI component, etc.)
140
+ - If building multiple similar items (e.g., 3 KPI cards), do them one at a time
141
+
142
+ **c) Check for lint and TypeScript errors**:
143
+ - Run `read_lints` on the files you just modified
144
+ - Fix ALL errors immediately
145
+ - Zero tolerance: Do not proceed with any linter or TypeScript errors
146
+ - Recheck after fixes to confirm all errors are resolved
147
+
148
+ **d) Reload browser to test**:
149
+ - Follow reload strategy in @browser-irisx-development
150
+ - Check browser console and network tab for errors
151
+ - Verify the feature renders correctly
152
+ - Take screenshot if visual changes
153
+
154
+ **f) Debug if needed**:
155
+ - Read console errors from browser
156
+ - Check network requests for GraphQL/API issues
157
+ - Adjust code and repeat from step c) (check lints, then reload browser) until feature works
158
+ - DO NOT move forward until this feature is working
159
+
160
+ **g) Update documentation**:
161
+ - Mark feature as completed in `/docs/[app-name].md`
162
+ - Document any important findings or gotchas
163
+
164
+ **h) Move to next feature**:
165
+ - Only proceed when current feature is verified working in browser with zero errors
166
+ - Repeat entire process for next feature in plan
167
+
168
+ **9. Continuous Validation Rules**
169
+ Throughout all of Phase 3:
170
+ - After EVERY code change: Check lints first, then reload browser (@browser-irisx-development)
171
+ - Fix ALL lint and TypeScript errors immediately (zero tolerance)
172
+ - Check browser console for errors after each reload
173
+ - Never implement multiple features without full validation between them
174
+
175
+ ### Phase 4: Completion
176
+
177
+ **10. Final Verification**
178
+ - Run `read_lints` on all modified files to ensure zero errors
179
+ - Test all features end-to-end in browser (@browser-irisx-development)
180
+ - Verify data loads correctly (real GraphQL data)
181
+ - Take screenshots of working features
182
+
183
+ **11. Summary**
184
+ Inform the user:
185
+ - All features implemented and verified in browser with zero errors
186
+ - No linter or TypeScript errors remaining
187
+ - Documentation at `docs/[app-name].md`
188
+ - App running at local dev server
189
+ - **Important**: User must deploy via Trackunit marketplace (never auto-submit)
190
+
191
+ ## Critical Development Rules
192
+
193
+ ### Strict Browser-First Workflow
194
+ **Follow this exact order:**
195
+
196
+ 1. Create app + extensions
197
+ 2. Start dev server immediately
198
+ 3. Open browser and verify extension loads (@browser-irisx-development)
199
+ 4. **STOP - Do not proceed without browser verification**
200
+ 5. Implement ONE feature with prerequisites
201
+ 6. Check lints and fix ALL errors (zero tolerance)
202
+ 7. Reload browser and verify that ONE feature (@browser-irisx-development)
203
+ 8. Repeat steps 5-7 for each remaining feature
204
+
205
+ ### Feature Implementation Rules
206
+ - **One feature at a time** - even if building similar components
207
+ - **Prerequisites on-demand** - set up GraphQL/scopes only when needed for current feature
208
+ - **Zero tolerance for errors** - fix all lint and TypeScript errors immediately after code changes
209
+ - **Test completely** - verify working in browser before moving on
210
+ - **Small incremental changes** - easier to debug when issues arise
211
+ - **Continuous validation** - lint check, then browser test after every change
212
+
213
+ ### Validation Checklist
214
+ After EVERY code change:
215
+ 1. Run `read_lints` on modified files
216
+ 2. Fix ALL linter and TypeScript errors (zero tolerance)
217
+ 3. Reload browser (see @browser-irisx-development for reload strategy)
218
+ 4. Check browser console and network tab for errors
219
+ 5. Verify UI renders correctly
220
+ 6. Take screenshot if visual changes
221
+ 7. Fix any issues before proceeding
222
+
223
+ ### Data & UI Development
224
+ - **GraphQL**: Use Trackunit MCP `introspect-schema` and `validate-query`, then implement per @irisx-app-sdk-graphql
225
+ - **Components**: Use Trackunit MCP `get-story-code` to find patterns, implement, verify in browser
226
+ - **Real Data**: Always use Trackunit GraphQL API, never mock data unless explicitly requested
@@ -0,0 +1,246 @@
1
+ # Browser Usage for IrisX App Development
2
+
3
+ ## Overview
4
+ This rule defines the browser-first workflow for developing and testing IrisX Apps in Trackunit Manager.
5
+
6
+ **⚠️ CRITICAL: IrisX Apps are ALWAYS tested at https://new.manager.trackunit.com/goto/iris-app-dev - NEVER on localhost!**
7
+
8
+ When the dev server runs locally (via `npx nx run [app-name]:serve`), it serves the app files, but you MUST test the app in the Trackunit Manager environment at the URL above. This is because IrisX apps are extensions that integrate into Trackunit Manager and require the host platform to function.
9
+
10
+ ## Initial Browser Setup
11
+
12
+ ### 1. Open Browser and Wait for Login
13
+ When starting IrisX App development:
14
+
15
+ ```
16
+ 1. Navigate to: https://new.manager.trackunit.com/goto/iris-app-dev
17
+ (This is THE ONLY URL to test IrisX apps - NEVER use localhost!)
18
+ 2. Inform user: "I've opened Trackunit Manager at https://new.manager.trackunit.com/goto/iris-app-dev. Please log in."
19
+ 3. Wait for user to complete login (be patient - may take 2-4 minutes)
20
+ 4. Do NOT proceed until you see the Trackunit Manager interface loaded
21
+ ```
22
+
23
+ ### 2. Verify Local Dev Mode is Enabled
24
+ After user is logged in, check if local dev mode is active:
25
+
26
+ ```
27
+ a) Take browser snapshot
28
+ b) Look for element with data-testid="local-mode-tooltip-parent" in the sidebar
29
+ c) If "Use Local Apps" toggle is visible and enabled → local dev mode is ON
30
+ d) If NOT found or NOT enabled → proceed to step 3
31
+ ```
32
+
33
+ ### 3. Enable Local Dev Mode (if needed)
34
+ If local dev mode is not enabled:
35
+
36
+ ```
37
+ a) Navigate to: https://new.manager.trackunit.com/goto/iris-app-dev
38
+ b) Wait for page to load
39
+ c) Take snapshot to verify the local dev mode page loaded
40
+ d) Look for "Use Local Apps" toggle in sidebar (data-testid="local-mode-tooltip-parent")
41
+ e) If toggle is OFF, click it to enable local dev mode
42
+ f) Wait 2 seconds for activation
43
+ g) Verify toggle is now ON
44
+ ```
45
+
46
+ ### 4. Navigate to Extension
47
+ Based on extension type, navigate to where the extension should appear:
48
+
49
+ **FLEET_EXTENSION:**
50
+ - Main menu → Look for your app name in the menu items
51
+ - Click to open the extension
52
+
53
+ **ASSET_HOME_EXTENSION:**
54
+ - Navigate to Assets → Open any asset
55
+ - Look for new tab with your extension name
56
+ - Click the tab
57
+
58
+ **SITE_HOME_EXTENSION:**
59
+ - Navigate to Sites → Open any site
60
+ - Look for new tab with your extension name
61
+ - Click the tab
62
+
63
+ **WIDGET_EXTENSION:**
64
+ - Navigate to Dashboard
65
+ - Click "Add Widget" or similar
66
+ - Look for your widget in the list
67
+
68
+ ## Testing After Code Changes
69
+
70
+ ### Reload Strategy
71
+ After making code changes to your extension:
72
+
73
+ **1. Check Lints First (Zero Tolerance):**
74
+ ```
75
+ - Run read_lints on modified files
76
+ - Fix ALL errors before testing in browser
77
+ - Do not proceed with any TypeScript or linter errors
78
+ ```
79
+
80
+ **2. Reload Browser:**
81
+ The dev server hot-reloads, but sometimes a full page refresh is needed:
82
+
83
+ ```
84
+ Option A - Wait for Hot Reload:
85
+ - Wait 2-3 seconds after saving files
86
+ - Check if changes appear automatically
87
+ - If extension goes blank or changes don't appear → proceed to Option B
88
+
89
+ Option B - Manual Refresh:
90
+ For macOS:
91
+ - Press Command+R to reload page
92
+ OR
93
+ - Use browser_snapshot, then browser_evaluate with: location.reload()
94
+
95
+ For Windows:
96
+ - Press Ctrl+R to reload page (use browser_press_key)
97
+ OR
98
+ - Use browser_evaluate with: location.reload()
99
+
100
+ Option C - Hard Refresh (if normal refresh doesn't work):
101
+ For macOS:
102
+ - Press Command+Shift+R for hard reload
103
+ OR
104
+ - Use browser_evaluate with: location.reload(true)
105
+
106
+ For Windows:
107
+ - Press Ctrl+Shift+R for hard reload
108
+ OR
109
+ - Use browser_evaluate with: location.reload(true)
110
+ ```
111
+
112
+ **⚠️ IMPORTANT - Manifest Changes Require Re-Serve:**
113
+ ```
114
+ If you modified iris-app-manifest.ts (scopes, CSP headers, metadata, etc.):
115
+ - Browser reload is NOT enough
116
+ - You MUST stop the dev server (Ctrl+C)
117
+ - Re-run: npx nx run [app-name]:serve
118
+ - Wait for server to restart
119
+ - Then reload browser
120
+
121
+ Manifest changes include:
122
+ - Adding/removing scopes
123
+ - Updating CSP headers (cspHeader)
124
+ - Changing app metadata
125
+ - Modifying extension configurations
126
+ ```
127
+
128
+ **3. Verify Extension Loaded:**
129
+ ```
130
+ - Take browser snapshot
131
+ - Look for your extension content
132
+ - Check if it's blank/empty → may need hard refresh
133
+ - Verify expected UI elements are present
134
+ ```
135
+
136
+ **4. Check Console for Errors:**
137
+ ```
138
+ - Use browser_console_messages tool
139
+ - Look for errors (red messages)
140
+ - Common issues:
141
+ - GraphQL errors (check scopes in manifest)
142
+ - CSP violations (update cspHeader in manifest)
143
+ - Module loading errors (check imports)
144
+ - Runtime errors (check code logic)
145
+ ```
146
+
147
+ **5. Check Network Requests (if using GraphQL/APIs):**
148
+ ```
149
+ - Use browser_network_requests tool
150
+ - Note: GraphQL returns 200 OK even with errors - inspect response bodies
151
+ - Look for "errors" array in GraphQL responses
152
+ - Check for HTTP status errors: 400 (bad syntax), 401/403 (auth/scopes), 500 (server error)
153
+ - Common issues: missing scopes in manifest, incorrect query structure
154
+ ```
155
+
156
+ ## Troubleshooting Common Issues
157
+
158
+ ### Extension Shows Blank After Changes
159
+ ```
160
+ 1. Try hard refresh (Command+Shift+R or Ctrl+Shift+R)
161
+ 2. Check browser console for errors
162
+ 3. Check if dev server is still running
163
+ 4. Verify file saved correctly
164
+ 5. Check for TypeScript compilation errors
165
+ 6. Navigate away and back to extension
166
+ ```
167
+
168
+ ### "Use Local Apps" Toggle Not Found
169
+ ```
170
+ 1. Verify user is logged in successfully
171
+ 2. Navigate directly to https://new.manager.trackunit.com/goto/iris-app-dev
172
+ 3. Wait for page to fully load
173
+ 4. Take snapshot to see what's visible
174
+ 5. Look for "Use Local Apps" toggle in sidebar (data-testid="local-mode-tooltip-parent")
175
+ 6. If found and OFF, click it to enable local dev mode
176
+ 7. Wait 2 seconds for activation
177
+ 8. Verify toggle is now ON
178
+ 9. May need to scroll sidebar to find toggle if not immediately visible
179
+ ```
180
+
181
+ ### Extension Not Appearing in Menu/Tabs
182
+ ```
183
+ 1. Verify dev server is running
184
+ 2. Check manifest.json has correct extension type
185
+ 3. If you changed iris-app-manifest.ts → MUST re-serve the app (stop and restart dev server)
186
+ 4. Hard refresh browser
187
+ 5. Disable and re-enable "Use Local Apps"
188
+ 6. Check browser console for loading errors
189
+ 7. Verify extension-manifest.ts is configured correctly
190
+ ```
191
+
192
+ ### GraphQL/API Errors
193
+ ```
194
+ 1. Use browser_network_requests to find GraphQL requests
195
+ 2. Inspect response body for "errors" array (GraphQL returns 200 even with errors)
196
+ 3. Common fixes:
197
+ - Missing scopes → Add to iris-app-manifest.ts scopes array
198
+ - CSP violations → Add domain to cspHeader in iris-app-manifest.ts
199
+ - Query errors → Use Trackunit MCP validate-query to test
200
+ - Auth issues → Deploy app to enable new scopes (inform user - never auto-deploy)
201
+ 4. If manifest was changed → restart dev server
202
+ ```
203
+
204
+ ## Workflow Integration
205
+
206
+ ### After Every Code Change:
207
+ 1. ✅ Check lints (zero tolerance)
208
+ 2. ✅ Fix all errors
209
+ 3. ✅ Wait 2-3 seconds for hot reload
210
+ 4. ✅ Refresh browser if needed
211
+ 5. ✅ Take snapshot
212
+ 6. ✅ Verify changes visible
213
+ 7. ✅ Check console for errors
214
+ 8. ✅ Check network tab if using APIs
215
+ 9. ✅ Fix any issues before proceeding
216
+
217
+ ### Before Moving to Next Feature:
218
+ 1. ✅ Current feature fully working in browser
219
+ 2. ✅ Zero linter/TypeScript errors
220
+ 3. ✅ Zero browser console errors
221
+ 4. ✅ All network requests successful
222
+ 5. ✅ Screenshot of working feature
223
+ 6. ✅ Documentation updated
224
+
225
+ ## Best Practices
226
+
227
+ 1. **Always Use https://new.manager.trackunit.com/goto/iris-app-dev:** Never test on localhost - IrisX apps require the Trackunit Manager host environment
228
+ 2. **Keep Browser Open:** Always keep browser tab visible during development
229
+ 3. **Snapshot Often:** Take snapshots after every change to verify UI
230
+ 4. **Console is Your Friend:** Check console after every reload
231
+ 5. **Network Tab for APIs:** Monitor all GraphQL/API requests
232
+ 6. **Refresh Strategy:** Try soft refresh first, hard refresh if needed
233
+ 7. **Patient with Login:** Give user adequate time to log in (2-4 minutes)
234
+ 8. **Verify Before Proceeding:** Always confirm extension loads before writing features
235
+ 9. **One Feature at a Time:** Test each feature completely before moving on
236
+
237
+ ## Critical Reminders
238
+
239
+ - **ALWAYS test at https://new.manager.trackunit.com/goto/iris-app-dev** - NEVER on localhost!
240
+ - **Never proceed without browser verification** after initial setup
241
+ - **Always check lints before browser testing** (zero tolerance for errors)
242
+ - **Reload browser after every code change** to see updates
243
+ - **Check console and network tab** for errors after each reload
244
+ - **Fix issues immediately** before moving to next feature
245
+ - **Take screenshots** to document working features
246
+ - **Be patient with user login** - don't rush the authentication process
@@ -77,4 +77,6 @@ IrisX Apps have access to runtime hooks from `@trackunit/react-core-hooks` that
77
77
 
78
78
  DO NOT use generic React/Node.js commands for project creation or management - always use the Trackunit IrisX App SDK commands.
79
79
 
80
+ **Before completing any task**: Always use `read_lints` to check for and fix all ESLint and TypeScript errors in modified files.
81
+
80
82