okay so this devlog is two commits because i wrote one, forgot to hit submit, and then went and ripped half of it back out lol
first commit, “various fixes”, which is doing a LOT of work as a title
penumbra has a WEB DEMO now!!!
there’s a new CI job that, on every push to main, builds the ui for wasm, runs wasm-bindgen on it, adds the index.html, and pushes the result to gh-pages
my comment above the assemble step says “sadly not using raw Assembly lol” and i am very proud of that one
that also meant every checkout in CI needed submodules: recursive, because last time i vendored my slint fork as a submodule and CI was like “what slint?” lmaooo.
told you i’d regret it
the web build also meant dealing with the clipboard. arboard is desktop only, (which i should change to an agnostic dependency sigh) so on wasm it talks to the browser clipboard instead, except the browser Clipboard API is async only. honest status on web: copy fires off the write and hopes it lands, and paste just returns an error and leaves it to the browser.
it compiles though hehe good enough for me
the map got fixed too. scrolling used to zoom no matter what, which on a trackpad was CHAOS. now scroll pans and ctrl/cmd + scroll zooms like every other canvas app. zoom is smooth instead of jumping in 10% steps (holy freak i spent like 10 minutes just playing with it it’s addicting), big trackpad flings get clamped so you don’t go flying, and dragging accounts for zoom, so the map actually stays under your cursor. the editor surface also got bigger (760x440 to 940x560), but there’s a // TODO: make dynamic and responsive sitting right on top of it. one day :3
i also made the editor way prettier in that commit. real heading sizes, quote bars, numbered lists that actually count, checkboxes, strikethrough, and TABLES drawn as a proper monospace grid with box drawing characters. i was so happy with it.
and then…
second commit: “markdown stuff changes AGAIN”. ripping out and dropkicking code you just wrote is SO ANNOYING
the problem was how the editor worked. it parsed your markdown into the AST, drew it as pretty styled text with the markers hidden, and when you typed it had to rebuild markdown from whatever was on screen. so every edit was a round trip through “guess what the user meant”, and that’s exactly how you end up quietly mangling someone’s notes. no thank you
so now the buffer IS the markdown. the actual characters in the editor are your file, byte for byte, and styling is just paint on top that never touches the text. my comment on it says “so we can’t corrupt the user’s markdown! XD” and yes that is the whole point. line endings stay attached to each line too, so CRLF, trailing whitespace, and blank lines all survive. saving is literally just reading the text back out, no rebuilding anything
there’s a new scan.rs that does the painting. it asks the parser which block each line belongs to (heading, code, quote, list, etc.) and styles the line based on that, then scans the line for inline stuff like bold, italic, and strikethrough. it restyles after every edit, undo, redo, cut, and paste. bold and italic toggles now put real ** and * into the text instead of just flipping a font weight, so they actually save. they only work within one line for now, there’s a // TODO: above about multi-line, and there’s also a “splice the trailing marker first (this was painful to discover)” comment because i inserted the first marker and all my byte offsets moved over lmao
the tradeoff is that the markers are visible now. you see the #, the **, the ~~, they’re just styled. it’s pseudo-WYSIWYG, and honestly i like it more. but yeah, that means the fancy table grid, the checkbox glyphs, and the list numbering from the first commit are gone. runs.rs and runs_table.rs got deleted the same day they got pretty. rip
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.