Skip to content

Commit f9af729

Browse files
committed
[[status]] reindexing support, better view
1 parent a49fde9 commit f9af729

File tree

11 files changed

+830
-2284
lines changed

11 files changed

+830
-2284
lines changed

app.js

+38-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {
88
Tray,
99
ipcMain } = require("electron")
1010
const path = require("path")
11+
const arg = require("arg")
1112
const defaultMenu = require("electron-default-menu")
1213
const windowStateKeeper = require("electron-window-state")
1314
const queryString = require("query-string")
@@ -24,6 +25,17 @@ let tray = null
2425
// register protocol
2526
app.setAsDefaultProtocolClient("ssb")
2627

28+
// Command-line args
29+
const args = arg({
30+
// Types
31+
"--help": Boolean,
32+
"--version": Boolean,
33+
"--rebuild-indexes": Boolean,
34+
"--package": String,
35+
"--view": String,
36+
})
37+
38+
2739
const createApplicationWindow = (patchfoxEvent = {}, windowState = false) => {
2840
let win
2941
let event = patchfoxEvent?.event || false
@@ -77,7 +89,7 @@ const createApplicationWindow = (patchfoxEvent = {}, windowState = false) => {
7789
})
7890

7991
// and load the index.html of the app.
80-
console.log("data", data)
92+
// console.log("data", data)
8193

8294
if (data?.url) {
8395
win.loadURL(data.url)
@@ -193,7 +205,13 @@ function startServer(identity) {
193205

194206
win.close()
195207

196-
createApplicationWindow(null, mainWindowState)
208+
if (args["--package"]) {
209+
let pkg = args["--package"]
210+
let view = args["--view"] ?? "view"
211+
createApplicationWindow({event: "package:go", data: {pkg, view}}, mainWindowState)
212+
} else {
213+
createApplicationWindow(null, mainWindowState)
214+
}
197215
}
198216
}
199217

@@ -208,7 +226,15 @@ function startServer(identity) {
208226
defaultHeight: 600
209227
})
210228

211-
createApplicationWindow(null, mainWindowState)
229+
console.log(process.argv)
230+
if (args["--package"]) {
231+
let pkg = args["--package"]
232+
let view = args["--view"] ?? "view"
233+
createApplicationWindow({event: "package:go", data: {pkg, view}}, mainWindowState)
234+
} else {
235+
createApplicationWindow(null, mainWindowState)
236+
}
237+
212238
})
213239
}
214240

@@ -241,7 +267,13 @@ app.on("ready", () => {
241267
if (defaultIdentity.startServer) {
242268
startServer(defaultIdentity)
243269
} else if (defaultIdentity) {
244-
createApplicationWindow()
270+
if (args["--package"]) {
271+
let pkg = args["--package"]
272+
let view = args["--view"] ?? "view"
273+
createApplicationWindow({event: "package:go", data: {pkg, view}})
274+
} else {
275+
createApplicationWindow()
276+
}
245277
} else {
246278
firstTimeSetup()
247279
}
@@ -282,7 +314,7 @@ app.on("activate", () => {
282314

283315
app.on("open-url", (event, url) => {
284316
event.preventDefault()
285-
console.log("urll", url)
317+
console.log("url", url)
286318
if (sbot) {
287319
createApplicationWindow({event: "package:open", data: { pkg: "intercept", view: "view", query: url }})
288320
} else {
@@ -424,8 +456,6 @@ ipcMain.on("tray:set", (event, items) => {
424456
return m
425457
}
426458

427-
console.log("items", items)
428-
429459
menu = items.map(i => makeMenu(i))
430460

431461
// FIXME: menu has wrong order for toplevel items.
@@ -456,3 +486,4 @@ ipcMain.on("tray:set", (event, items) => {
456486

457487
tray.setContextMenu(finalMenu)
458488
})
489+

docs/message_types/about.md

+38-38
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
# about (profile update)
2-
About messages are used to add additional information to another message, much like attaching post-it notes to some book page. You're _attaching information about_ something. Most use cases of `about` messages are to add names, images and descriptions to a user profile.
3-
4-
> **Attention:** There is no central authority handling names on the Scuttleverse. Much like in the physical world where two people can have the exact same name so it is on Scuttlebutt.
5-
>
6-
> You can name other people as well, just like partners and friends do.
7-
8-
9-
## What does it look like?
10-
11-
~~~
12-
{
13-
"key": "%buRChtQMrk/WjZQsfsgsg17XHmSDnMMKfFEXv/bjL43lQ=.sha256",
14-
"value": {
15-
"previous": null,
16-
"sequence": 1,
17-
"author": "@G/zUdqlPsdgsgd8yXIfMjx1676ApAOghwgc=.ed25519",
18-
"timestamp": 1560287825423,
19-
"hash": "sha256",
20-
"content": {
21-
"type": "about",
22-
"about": "@G/zUdqlPMsdgsdg8yXIfMjx1676ApAOghwgc=.ed25519",
23-
"image": "&N3ectV2qM5gyH2Zrsdgsdgd+InCMkJBc/MaTbJ0=.sha256",
24-
"name": "Hilo",
25-
"description": "extrem klug"
26-
},
27-
"signature": "UMjf4aFsdgsgUY9zeDAqWdTZeymoQznicvfgATu0/kArvLnshqbkiG7ZIngXcnztMUc6SyI4GrDwkAA==.sig.ed25519"
28-
},
29-
"timestamp": 1560288248693,
30-
"rts": 1560287825423
31-
}
32-
~~~
33-
34-
The message above is adding a `name`, an `image` and a `description` to the user specified by the `about` field.
35-
36-
There is a lot more [information about `about` online](http://scuttlebot.io/docs/message-types/about.html).
37-
38-
391
# about (gathering)
402

413
`about` messages are very flexible. They are often used to add or alter metadata _about_ some other message. In Patchfox documentation, I use the jargon that this message is _overloaded_ and it's meaning depends on which message it is _abouting_ about.
@@ -89,3 +51,41 @@ Let's look at another case of `about` being used with _gatherings_:
8951
```
9052

9153
That message is marking a _feed_ (aka a user) as attending the _gathering_.
54+
55+
56+
# about (profile update)
57+
About messages are used to add additional information to another message, much like attaching post-it notes to some book page. You're _attaching information about_ something. Most use cases of `about` messages are to add names, images and descriptions to a user profile.
58+
59+
> **Attention:** There is no central authority handling names on the Scuttleverse. Much like in the physical world where two people can have the exact same name so it is on Scuttlebutt.
60+
>
61+
> You can name other people as well, just like partners and friends do.
62+
63+
64+
## What does it look like?
65+
66+
~~~
67+
{
68+
"key": "%buRChtQMrk/WjZQsfsgsg17XHmSDnMMKfFEXv/bjL43lQ=.sha256",
69+
"value": {
70+
"previous": null,
71+
"sequence": 1,
72+
"author": "@G/zUdqlPsdgsgd8yXIfMjx1676ApAOghwgc=.ed25519",
73+
"timestamp": 1560287825423,
74+
"hash": "sha256",
75+
"content": {
76+
"type": "about",
77+
"about": "@G/zUdqlPMsdgsdg8yXIfMjx1676ApAOghwgc=.ed25519",
78+
"image": "&N3ectV2qM5gyH2Zrsdgsdgd+InCMkJBc/MaTbJ0=.sha256",
79+
"name": "Hilo",
80+
"description": "extrem klug"
81+
},
82+
"signature": "UMjf4aFsdgsgUY9zeDAqWdTZeymoQznicvfgATu0/kArvLnshqbkiG7ZIngXcnztMUc6SyI4GrDwkAA==.sig.ed25519"
83+
},
84+
"timestamp": 1560288248693,
85+
"rts": 1560287825423
86+
}
87+
~~~
88+
89+
The message above is adding a `name`, an `image` and a `description` to the user specified by the `about` field.
90+
91+
There is a lot more [information about `about` online](http://scuttlebot.io/docs/message-types/about.html).

docs/packages/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ These are the packages that Patchfox is loading.
66
* [KoFiIntegration](/packages/KoFiIntegration/)
77
* [blog](/packages/blog/)
88
* [books](/packages/books/)
9+
* [calendar](/packages/calendar/)
910
* [errorHandler](/packages/errorHandler/)
1011
* [contacts](/packages/contacts/)
11-
* [calendar](/packages/calendar/)
1212
* [firstTimeSetup](/packages/firstTimeSetup/)
1313
* [githubIntegration](/packages/githubIntegration/)
1414
* [globalMenu](/packages/globalMenu/)
@@ -25,7 +25,7 @@ These are the packages that Patchfox is loading.
2525
* [settings](/packages/settings/)
2626
* [settings-old](/packages/settings-old/)
2727
* [sourcehutIntegration](/packages/sourcehutIntegration/)
28+
* [statusBar](/packages/statusBar/)
2829
* [system](/packages/system/)
2930
* [vote](/packages/vote/)
3031
* [zine](/packages/zine/)
31-
* [statusBar](/packages/statusBar/)

0 commit comments

Comments
 (0)