Did a huge storage refactor.
The main problem with the current code is that upon any action that changes options, a callback must be called to update the field in storage. A similar callback must be implemented for each option upon load. This process is quite tedious, and it also makes the codebase littered with storage calls.
I fixed this by using one central appState variable that defines a schema for the save format, and used a $effect to sync the storage whenever certain variables in appState changed.
But this kinda broke everything, so I had to go around fixing bugs for multiple hours.
Anyway, if you’re reading this, here’s a short userscript to add spacing between the paragraphs of a devlog:
import { pa, pn, pq, ps, pt, pv } from "@page-proxy/pp";
// ==Page Proxy==
// @title Add space after paragraph
// @website https://*.hackclub.com/projects/*
// @description Add space after paragraph to devlogs and ship messages
// @author orangishcat
// @grant run-on-page-load
// ==/Page Proxy==
// ==Selectors==
ps.injectCSS(`
div.post__body p
{
margin: 0.85rem 0;
}
div.post__body li
{
margin: 0.5rem 0;
}
`);
// ==/Selectors==
And here it is in Tampermonkey format:
// ==UserScript==
// @name Add space after paragraph
// @match https://*.hackclub.com/projects/*
// @description Add space after paragraph to devlogs and ship messages
// @version 0.1.0
// @author orangishcat
// @run-at document-start
// @require https://orangishcat.github.io/page-proxy/pp/pp.min.js
// ==/UserScript==
// ==Selectors==
ps.injectCSS(`
div.post__body p
{
margin: 0.85rem 0;
}
div.post__body li
{
margin: 0.5rem 0;
}
`);
// ==/Selectors==
I’ve attached a side-by-side comparison.(left = before, right = after).