@bobfrankston/msger 0.1.74 → 0.1.76
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/KNOWN-BUGS.md +121 -0
- package/MSGER-API-SUMMARY.md +162 -0
- package/MSGER-API.md +376 -0
- package/README.md +93 -0
- package/SESSION-2025-11-06.md +191 -0
- package/SESSION-NOTES.md +678 -0
- package/clihandler.d.ts.map +1 -1
- package/clihandler.js +62 -2
- package/clihandler.js.map +1 -1
- package/clihandler.ts +60 -2
- package/icon.png +0 -0
- package/icon1.png +0 -0
- package/msger-native/Cargo.toml +1 -0
- package/msger-native/bin/msgernative.exe +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Breadcrumbs +12 -118
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/BrowserMetrics/{BrowserMetrics-690552AF-DCD4.pma → BrowserMetrics-690B9AD3-657C.pma} +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/BrowserMetrics/{BrowserMetrics-69055373-F88C.pma → BrowserMetrics-690BA05A-501C.pma} +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Crashpad/settings.dat +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/BrowsingTopicsState +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/data_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/{BrowserMetrics/BrowserMetrics-69055587-A65C.pma → Default/Cache/Cache_Data/data_2} +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/data_3 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000001 +383 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000002 +1091 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000003 +2153 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000004 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000005 +626 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/f_000006 +393 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Cache/Cache_Data/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/01241693cfdc32b9_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/0ba1eea781f3552c_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/323aa210eebefe2c_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/4608446ac118e77a_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/6938205dc2f77841_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/6de12299dc89e5f3_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/8f403c112eaa455b_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/9a3aceb491137f07_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/aedb266cbaf9c28f_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/ca526fdda86d0b9d_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/f5d11d783c9fdf69_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Code Cache/js/index-dir/the-real-index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Collections/collectionsSQLite +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Collections/collectionsSQLite-journal +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DIPS +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnGraphiteCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnGraphiteCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnWebGPUCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnWebGPUCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Extension State/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Extension State/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Favicons +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/GPUCache/data_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/GPUCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/GPUCache/data_2 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/GPUCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/History +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/MediaDeviceSalts +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/MediaDeviceSalts-journal +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Network/Network Persistent State +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Network/TransportSecurity +1 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Preferences +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/CacheStorage/14e849fa8522d406112ea607cf7fd6342b71b987/249ee9af-c3df-4a86-89a8-2c51f3370ee0/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/CacheStorage/14e849fa8522d406112ea607cf7fd6342b71b987/249ee9af-c3df-4a86-89a8-2c51f3370ee0/index-dir/the-real-index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/CacheStorage/14e849fa8522d406112ea607cf7fd6342b71b987/index.txt +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/CURRENT +1 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/LOCK +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/LOG +3 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/LOG.old +3 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/Database/MANIFEST-000001 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/ScriptCache/2cc80dabc69f58b6_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/ScriptCache/2cc80dabc69f58b6_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/ScriptCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Service Worker/ScriptCache/index-dir/the-real-index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Site Characteristics Database/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager-journal +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/favorites_diagnostic.log +27 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG.old +3 -3
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_3 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/f_000003 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/f_000004 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GraphiteDawnCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GraphiteDawnCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Local State +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/RevisitationBloomfilter +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/ShaderCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/ShaderCache/index +0 -0
- package/msger-native/src/main.rs +343 -37
- package/msger-native/src/template.html +103 -28
- package/msger-storage-demo.html +290 -0
- package/msger.code-workspace +3 -0
- package/msgerdefs/README.md +122 -0
- package/msgerdefs/msgerdefs.d.ts +322 -0
- package/msgerdefs/msgerdefs.d.ts.map +1 -0
- package/msgerdefs/msgerdefs.js +110 -0
- package/msgerdefs/msgerdefs.js.map +1 -0
- package/msgerdefs/msgerdefs.ts +427 -0
- package/msgerdefs/package.json +38 -0
- package/msgerdefs/samples.html +431 -0
- package/msgerdefs/test1.cmd +1 -0
- package/msgerdefs/tsconfig.json +17 -0
- package/msgernative-linux-x64 +0 -0
- package/package.json +5 -1
- package/shower.d.ts +2 -0
- package/shower.d.ts.map +1 -1
- package/shower.js +17 -0
- package/shower.js.map +1 -1
- package/shower.ts +24 -0
- package/test-data-persistence.html +315 -0
- package/test-htmlfrom.html +29 -0
- package/test-ipc-reach.html +113 -0
- package/test-msger-api.html +120 -0
- package/test-msger-functions.html +325 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/BrowserMetrics/BrowserMetrics-69055419-C8A0.pma +0 -0
package/README.md
CHANGED
|
@@ -512,6 +512,99 @@ Notes:
|
|
|
512
512
|
- Runtime zoom: Ctrl+Wheel, Ctrl+Plus, Ctrl+Minus
|
|
513
513
|
```
|
|
514
514
|
|
|
515
|
+
## Current Status & Known Issues (v0.1.74)
|
|
516
|
+
|
|
517
|
+
### What Works ✅
|
|
518
|
+
|
|
519
|
+
**Template Mode** (using `-message`, `-html`, `-htmlfrom`):
|
|
520
|
+
- ✅ OK/Cancel buttons work perfectly
|
|
521
|
+
- ✅ Button results returned to parent process via IPC
|
|
522
|
+
- ✅ Custom buttons, input fields, forms all work
|
|
523
|
+
- ✅ Native browser localStorage (recommended - works everywhere)
|
|
524
|
+
- ✅ IPC communication functional
|
|
525
|
+
|
|
526
|
+
**URL Mode** (using `-url`):
|
|
527
|
+
- ✅ Direct webpage loading
|
|
528
|
+
- ✅ PWA support (Service Workers, IndexedDB, Cache API)
|
|
529
|
+
- ✅ Full web functionality
|
|
530
|
+
- ✅ Native browser APIs work perfectly
|
|
531
|
+
|
|
532
|
+
**General Features:**
|
|
533
|
+
- ✅ Fast native window creation (~50-200ms)
|
|
534
|
+
- ✅ Isolated storage (%LOCALAPPDATA%\msger\webview2\)
|
|
535
|
+
- ✅ F11 HTML5 fullscreen (content fullscreen, not native window)
|
|
536
|
+
- ✅ `-fullscreen` CLI flag for native window fullscreen
|
|
537
|
+
- ✅ DevTools (press F12)
|
|
538
|
+
- ✅ Esc key to close windows
|
|
539
|
+
- ✅ Auto-close with `-timeout`
|
|
540
|
+
- ✅ Detached mode with `-detach`
|
|
541
|
+
|
|
542
|
+
### msger JavaScript API
|
|
543
|
+
|
|
544
|
+
**Minimal API** - Most functionality uses native browser APIs:
|
|
545
|
+
- `msger.isAvailable()` - Feature detection (returns true in msger)
|
|
546
|
+
- `msger.close()` - Same as `window.close()` (native API preferred)
|
|
547
|
+
- **localStorage functions** - Optional convenience wrappers (native localStorage recommended)
|
|
548
|
+
|
|
549
|
+
**Recommendation:** Use native browser APIs (`localStorage`, `window.close()`) for compatibility. Code will work in any browser context, not just msger.
|
|
550
|
+
|
|
551
|
+
### Known Limitations ❌
|
|
552
|
+
|
|
553
|
+
**URL Mode IPC (wry 0.47.2 bug):**
|
|
554
|
+
- ❌ All IPC calls crash in `-url` mode with injected scripts
|
|
555
|
+
- ❌ No window control buttons work in URL mode
|
|
556
|
+
- **Workaround:** Use template mode (`-htmlfrom` instead of `-url`) if you need buttons
|
|
557
|
+
|
|
558
|
+
**F11 Fullscreen:**
|
|
559
|
+
- ❌ F11 triggers HTML5 fullscreen (content only), not native window fullscreen
|
|
560
|
+
- ❌ WebView2 captures F11 before Rust window handler
|
|
561
|
+
- **Workaround:** Use `-fullscreen` CLI flag for native fullscreen
|
|
562
|
+
|
|
563
|
+
**-dev Flag:**
|
|
564
|
+
- ❌ Can't auto-open DevTools (wry 0.47.2 doesn't expose open_devtools() method)
|
|
565
|
+
- **Workaround:** Press F12 manually (DevTools always enabled)
|
|
566
|
+
|
|
567
|
+
**-htmlfrom with External Resources:**
|
|
568
|
+
- ⚠️ External CSS/JS/images may be blocked by CSP when embedding HTML
|
|
569
|
+
- **Workaround:** Use `-url` for pages with external resources, or use self-contained HTML
|
|
570
|
+
|
|
571
|
+
### Mode Comparison
|
|
572
|
+
|
|
573
|
+
| Feature | `-message/-html` | `-htmlfrom` | `-url` |
|
|
574
|
+
|---------|------------------|-------------|--------|
|
|
575
|
+
| OK/Cancel buttons | ✅ | ✅ | ❌ |
|
|
576
|
+
| Button results via IPC | ✅ | ✅ | ❌ (crashes) |
|
|
577
|
+
| Native localStorage | ✅ | ✅ | ✅ |
|
|
578
|
+
| Native window.close() | ✅ | ✅ | ✅ |
|
|
579
|
+
| External resources | N/A | ⚠️ CSP blocks | ✅ |
|
|
580
|
+
| PWA features | Limited | Limited | ✅ |
|
|
581
|
+
| msger API needed? | No (native APIs work) | No (native APIs work) | No (IPC broken) |
|
|
582
|
+
| Use case | Simple dialogs | Embedded HTML | Full web pages |
|
|
583
|
+
|
|
584
|
+
### Security Note
|
|
585
|
+
|
|
586
|
+
⚠️ **msger is designed for displaying trusted, friendly content** (local apps, your HTML files). It is NOT a secure sandbox for untrusted/hostile web content. Use `-htmlfrom` and `-url` with trusted sources only.
|
|
587
|
+
|
|
588
|
+
### Future Improvements
|
|
589
|
+
|
|
590
|
+
1. **File System API** - Native file access for platform apps
|
|
591
|
+
- **File dialogs** (always safe): `msger.selectFile()`, `msger.selectFiles()`, `msger.saveFileAs()`, `msger.selectFolder()`
|
|
592
|
+
- **Direct path access** (requires `--allowFs` flag): `msger.fs.read(path)`, `msger.fs.write(path, content)`, `msger.fs.list(path)`, etc.
|
|
593
|
+
- Returns actual file paths (better than `<input type="file">`)
|
|
594
|
+
- Possible in template mode using bidirectional IPC (same mechanism as button clicks)
|
|
595
|
+
- See SESSION-NOTES.md for full implementation approach
|
|
596
|
+
|
|
597
|
+
2. **Window Manipulation APIs** - Runtime window control in template mode
|
|
598
|
+
- `msger.setSize()`, `msger.setPosition()`, `msger.setTitle()`, etc.
|
|
599
|
+
- IPC works in template mode, these were disabled prematurely
|
|
600
|
+
- Can be re-enabled with bidirectional IPC pattern
|
|
601
|
+
|
|
602
|
+
3. **Periodic wry updates** - Check if URL mode IPC bug fixed in newer versions
|
|
603
|
+
- Would enable file/window APIs in URL mode too
|
|
604
|
+
- Currently works only in template mode
|
|
605
|
+
|
|
606
|
+
4. Cross-compile support for Raspberry Pi on Windows
|
|
607
|
+
|
|
515
608
|
## License
|
|
516
609
|
|
|
517
610
|
ISC
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Session 2025-11-06 Summary
|
|
2
|
+
|
|
3
|
+
## What Was Accomplished
|
|
4
|
+
|
|
5
|
+
### 1. Fixed `nul` File Git Error
|
|
6
|
+
**Problem:** `npm run installer` failed with "error: unable to index file 'nul'"
|
|
7
|
+
- Windows reserved device name (`nul`) was being tracked by Git
|
|
8
|
+
- Caused fatal error during `git add -A`
|
|
9
|
+
|
|
10
|
+
**Fix:**
|
|
11
|
+
- Removed `nul` file
|
|
12
|
+
- Added `nul` and `NUL` to `.gitignore`
|
|
13
|
+
|
|
14
|
+
### 2. Added Repository Field to package.json Files
|
|
15
|
+
**Problem:** Missing repository field (from programming.md requirement)
|
|
16
|
+
|
|
17
|
+
**Fix:**
|
|
18
|
+
- Added repository field to main `package.json`:
|
|
19
|
+
```json
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/BobFrankston/msger.git"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
- Added repository field to `msgerdefs/package.json` with `"directory": "msgerdefs"`
|
|
26
|
+
|
|
27
|
+
**Benefit:** npm package pages will show GitHub link
|
|
28
|
+
|
|
29
|
+
### 3. Clarified msger API Philosophy
|
|
30
|
+
**Discovery:** Storage API is redundant - native `localStorage` is preferred for compatibility
|
|
31
|
+
|
|
32
|
+
**Changes:**
|
|
33
|
+
- Removed all storage wrapper functions from `template.html`
|
|
34
|
+
- Simplified `window.msger` to only have `isAvailable()`
|
|
35
|
+
- Updated documentation to recommend native browser APIs
|
|
36
|
+
|
|
37
|
+
**New msger API (v0.1.74):**
|
|
38
|
+
```javascript
|
|
39
|
+
window.msger = {
|
|
40
|
+
isAvailable: function() { return true; }
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Use native APIs instead:
|
|
44
|
+
localStorage.setItem('key', JSON.stringify(value));
|
|
45
|
+
const value = JSON.parse(localStorage.getItem('key'));
|
|
46
|
+
window.close();
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Philosophy:** msger is a CLI tool, not a JavaScript library. Use native browser APIs for compatibility.
|
|
50
|
+
|
|
51
|
+
### 4. Fixed Multi-Monitor Positioning Bug
|
|
52
|
+
**Problem:** `-pos 10,10,1` placed window on wrong monitor
|
|
53
|
+
- Code assumed monitors arranged left-to-right
|
|
54
|
+
- Added widths of all previous monitors (incorrect!)
|
|
55
|
+
- Didn't account for actual OS monitor positions
|
|
56
|
+
|
|
57
|
+
**Fix in `main.rs` (lines 296-323):**
|
|
58
|
+
```rust
|
|
59
|
+
// Get the specific monitor by index
|
|
60
|
+
if let Some(monitor) = monitors.get(screen_num as usize) {
|
|
61
|
+
// Get the monitor's actual position from the OS
|
|
62
|
+
let monitor_pos = monitor.position();
|
|
63
|
+
|
|
64
|
+
// Add user's offset to monitor's position
|
|
65
|
+
x += monitor_pos.x;
|
|
66
|
+
y += monitor_pos.y;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Result:** Now correctly positions windows on any monitor regardless of arrangement
|
|
71
|
+
|
|
72
|
+
### 5. Documented Future File/Window APIs
|
|
73
|
+
**Added comprehensive notes for next week's implementation:**
|
|
74
|
+
|
|
75
|
+
**File System API (when time for debugging):**
|
|
76
|
+
- File dialogs (always safe): `selectFile()`, `selectFiles()`, `saveFileAs()`, `selectFolder()`
|
|
77
|
+
- Direct path access (requires `--allowFs`): `fs.read()`, `fs.write()`, `fs.list()`, `fs.exists()`, `fs.mkdir()`
|
|
78
|
+
- Goal: Make msger feasible for writing platform apps
|
|
79
|
+
|
|
80
|
+
**Window Manipulation APIs:**
|
|
81
|
+
- Runtime control in template mode: `setSize()`, `setPosition()`, `setTitle()`, `setAlwaysOnTop()`
|
|
82
|
+
- IPC works in template mode - these were disabled prematurely
|
|
83
|
+
- Can be re-enabled with bidirectional IPC pattern
|
|
84
|
+
|
|
85
|
+
**Why these will work:**
|
|
86
|
+
- IPC proven to work perfectly in template mode (button clicks use it)
|
|
87
|
+
- Just need bidirectional pattern (JavaScript → Rust → JavaScript)
|
|
88
|
+
- Use `webview.evaluate_script()` to send results back to JavaScript
|
|
89
|
+
|
|
90
|
+
### 6. Created Documentation Files
|
|
91
|
+
|
|
92
|
+
**MSGER-API-SUMMARY.md:**
|
|
93
|
+
- Complete overview of current minimal API
|
|
94
|
+
- Philosophy explanation (CLI tool, not JS library)
|
|
95
|
+
- Native browser API recommendations
|
|
96
|
+
- Future API plans
|
|
97
|
+
- Comparison to Electron
|
|
98
|
+
|
|
99
|
+
**Updated README.md:**
|
|
100
|
+
- Current status section (v0.1.74)
|
|
101
|
+
- msger JavaScript API section (minimal by design)
|
|
102
|
+
- Mode comparison table with native API row
|
|
103
|
+
- Future improvements with implementation notes
|
|
104
|
+
- Removed fixed multi-monitor bug notice
|
|
105
|
+
|
|
106
|
+
**Updated SESSION-NOTES.md:**
|
|
107
|
+
- "Recently Fixed" section for multi-monitor positioning
|
|
108
|
+
- Comprehensive File/Window API implementation plan
|
|
109
|
+
- Periodic wry update check reminder
|
|
110
|
+
- Updated "What Works" to emphasize native APIs
|
|
111
|
+
|
|
112
|
+
## Files Modified
|
|
113
|
+
|
|
114
|
+
### Source Code
|
|
115
|
+
- `msger-native/src/main.rs` - Fixed multi-monitor positioning logic
|
|
116
|
+
- `msger-native/src/template.html` - Removed storage API, simplified to `isAvailable()` only
|
|
117
|
+
- `.gitignore` - Added `nul` and `NUL`
|
|
118
|
+
- `package.json` - Added repository field
|
|
119
|
+
- `msgerdefs/package.json` - Added repository field with directory
|
|
120
|
+
|
|
121
|
+
### Documentation
|
|
122
|
+
- `README.md` - Updated current status, API section, future plans
|
|
123
|
+
- `SESSION-NOTES.md` - Updated priorities, recently fixed, API clarification
|
|
124
|
+
- `MSGER-API-SUMMARY.md` - Created comprehensive API overview
|
|
125
|
+
- `SESSION-2025-11-06.md` - This file
|
|
126
|
+
|
|
127
|
+
### Binaries
|
|
128
|
+
- `msger-native/bin/msgernative.exe` - Rebuilt with all fixes
|
|
129
|
+
|
|
130
|
+
## Key Insights
|
|
131
|
+
|
|
132
|
+
### What msger Really Is
|
|
133
|
+
**msger = Fast CLI wrapper for native windows + HTML + button results**
|
|
134
|
+
|
|
135
|
+
Not a JavaScript API library. The value is:
|
|
136
|
+
1. Speed and size (10-20x faster, 50x smaller than Electron)
|
|
137
|
+
2. Button results returned to parent process (template mode)
|
|
138
|
+
3. CLI-driven configuration
|
|
139
|
+
4. Native webview integration
|
|
140
|
+
|
|
141
|
+
Everything else (storage, rendering, PWAs) is standard browser functionality.
|
|
142
|
+
|
|
143
|
+
### IPC Status
|
|
144
|
+
- ✅ **Template mode**: IPC works perfectly (proven by button clicks)
|
|
145
|
+
- ❌ **URL mode**: IPC crashes (wry 0.47.2 bug)
|
|
146
|
+
- 💡 **Insight**: File and window APIs will work in template mode using same IPC mechanism
|
|
147
|
+
|
|
148
|
+
### Native API Preference
|
|
149
|
+
Use native browser APIs for compatibility:
|
|
150
|
+
- `localStorage` instead of `msger.saveData()`
|
|
151
|
+
- `window.close()` instead of `msger.close()`
|
|
152
|
+
- `<input type="file">` for now (until file API implemented)
|
|
153
|
+
|
|
154
|
+
Code will work in any browser context, not just msger.
|
|
155
|
+
|
|
156
|
+
## Next Steps (Week of 2025-11-11+)
|
|
157
|
+
|
|
158
|
+
### Priority 1: File System API
|
|
159
|
+
When you have time for debugging:
|
|
160
|
+
1. Add `rfd = "0.14"` to Cargo.toml
|
|
161
|
+
2. Implement bidirectional IPC pattern
|
|
162
|
+
3. Add file dialog functions (always safe)
|
|
163
|
+
4. Add direct path operations (with `--allowFs` flag)
|
|
164
|
+
5. Test thoroughly
|
|
165
|
+
|
|
166
|
+
### Priority 2: Window Manipulation APIs
|
|
167
|
+
Re-enable runtime window control in template mode:
|
|
168
|
+
1. Use same bidirectional IPC as file API
|
|
169
|
+
2. Test `setSize()`, `setPosition()`, `setTitle()`, etc.
|
|
170
|
+
|
|
171
|
+
### Priority 3: Periodic wry Update
|
|
172
|
+
Check if newer wry versions fix URL mode IPC crash.
|
|
173
|
+
|
|
174
|
+
## Testing
|
|
175
|
+
|
|
176
|
+
Test multi-monitor fix:
|
|
177
|
+
```bash
|
|
178
|
+
# Should now place window on second monitor (screen 1)
|
|
179
|
+
msger -message "Test Screen 1" -pos 10,10,1
|
|
180
|
+
|
|
181
|
+
# Test on third monitor
|
|
182
|
+
msger -message "Test Screen 2" -pos 10,10,2
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Version
|
|
186
|
+
|
|
187
|
+
Current version: **v0.1.74** (updated from v0.1.57)
|
|
188
|
+
- Minimal JavaScript API (native browser APIs preferred)
|
|
189
|
+
- Fixed multi-monitor positioning
|
|
190
|
+
- Repository fields added
|
|
191
|
+
- Ready for npm publish
|