giszmo / nostroid Goto Github PK
View Code? Open in Web Editor NEWA fast cross platform nostr client that even works offline
Home Page: https://chat.nostr.info
License: Other
A fast cross platform nostr client that even works offline
Home Page: https://chat.nostr.info
License: Other
When selecting an event, show the full context:
Currently, the app loads a bunch of default accounts. This script should only be executed if the user clicks on a button to do so. This feature is a debug feature anyway but for debugging it's still helpful, so it should not be removed completely yet.
The reason why I want it to be removed is to make links to events and profiles load quicker for users that don't have a saturated local db yet. I want to share for example https://chat.nostr.info/event/435c44c5b5dd8abceefe5f4ac176165618732178f4864d822979153a3fe9ad7f/ on Telegram but in its current state that's an embarrassment and whoever clicked it will never come back.
This can be split in two parts:
Especially at startup, Dexie DB hooks appear to not fire, sometimes for up to 20s at a time.
The event writer reports to usually take 100ms to write 500 events and takes 100ms pauses between single-threaded writing but something is happening on that thread that makes those 100ms writes take up to 20s during which all nostroid reactivity breaks down.
My suspicion is that something CPU-intensive kicks in that slows down everything or some other DB reading/writing affects the event writer. Could it be the Garbage Collector? I certainly produce a lot of garbage all the time everywhere. This needs to be debugged. Where is the biggest potential to avoiding garbage?
Currently there is no attention paid yet to CLS, a metric rightfully important to Google's page ranking. Under this issue, lets see how to address this.
Depending on one's settings, browsers might not allow the use of IDB. For example if Firefox is set to delete all data on close, websites are not allowed to write IDB in the first place.
I just noticed that https://polycentric.io/setup asks for permission to persist data. While I'm not sure what I just approved of (I can't see the site being added to the exceptions for data to be deleted on close), something like this is needed for Nostroid, too: Either a one-click solution or a clear warning: "This browser doesn't allow us do our thing. Please read this blog post on why that might be happening."
As described in nip 10, positional e-tags are still in wide use and should be considered if an explicit root or reply e-tag cannot be found.
https://github.com/Giszmo/nostroid/blob/master/src/routes/event/%5Bid%5D/%2Bpage.svelte#L50
When running pnpm run build
, some text (not marked as error or warning) is shown about circular dependencies:
Circular dependency: node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js -> node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_duplex.js -> node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js
Circular dependency: node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_duplex.js -> node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js -> node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_duplex.js
Circular dependency: node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js -> node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/readable.js -> node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js
Circular dependency: node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js -> node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/writable.js -> node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js
This looks like this issue and while the first instance can be solved using hacks described here, these do not solve the second pair of circular dependencies above.
Is this a problem? Do we have to fix it? If so, how?
Implement nip-10 compliant replies for all Text Notes.
Check nip05 if set and give a checkmark if verification succeeded. Mark the user as suspicious and don't show the nip05 handle if the verification fails. Maybe a question mark with a notification onClick about the verification failing.
While I want this project to be FOSS, I'm not decided on a particular license yet.
Please leave your comments on the subject here.
I'm not a lawyer but I think, LGPL would be the most suited.
The client might have embeddable versions, so I don't want projects that embed it to worry about the license of their own project. That excludes GPL.
On the other hand, if somebody does modify the code, I want the right to use their changes here, too, which excludes MIT.
If there are no objections to LGPL, I'll apply it in two weeks.
When new messages or notifications are received, those events should be shown with counters and the events themselves should be shown with a different background tone.
On Twitter I often "like" comments that ask for clarification but that doesn't subscribe me to the answers they might get.
Allow the user to "subscribe to thread" on any text note.
Implement the feed tab. It should show events authored by the in-group, with context. Like Twitter, the context should not branch out but initially show only the most relevant author's events, indicating when there are more replies from the in-group with a reply counter.
In the settings, add a list of relays.
As a first step, copy how Astral does it.
Mark the first relay as "primary" relay. Here we will get events from first. The others might get updates more throttled to avoid burst flooding with duplicate events.
With this issue, all relays are being connected at startup as equals.
should be nostroid-config.js
;)
Thread view is already pretty cool but it should show how many replies each message got like Twitter does it.
@Giszmo just a reminder if you want to give it a try: https://sqlite.org/wasm/doc/tip/about.md
Many more advanced users dread giving many apps their private keys, so they use nos2x or alby to sign events or decrypt messages.
https://github.com/nostr-protocol/nips/blob/master/07.md
window.nostr.signEvent()
if pubkey is window.nostr.getPublicKey()
Implementation of support for account addition from window.nostr.getPublicKey()
"Your nostr extension has an account you haven't added yet. Do you want to use with Nostroid?". Is low priority.
I suspect the logic where after a sync the app stores to be in sync up to now()
is flawed. It might store that even on failure and then never again try to get events for that time window.
The recent changes to introduce a drag handle on the profiles broke profile creation. New profiles are only shown upon reload.
Currently all own accounts get assigned a degree:0, their follows that are not own accounts get assigned a degree:1 and their follows are degree:2 etc. This logic is relevant for the SharedWorker to know which events to download from relays but follows might be distinct between own accounts.
It's probably most efficient to implement a store of relevant accounts aka "in-group" where other components can quickly lookup which author to prioritize over another or which to disregard completely.
When doing a "mention" and then hitting the left arrow, the dropdown opens again but hitting to the right, doesn't let you back out of it. When you repeat hitting left beyond the @ you get the full list of profiles. If you now hit enter, it closes but gives you no clue if the last selected mention was added to the tags or what happened.
SyntaxError: import declarations may only appear at top level of a module data.worker.ts:1
This stops events and profiles being loaded
Allow exporting the account's private key on the settings page. By default it should be hidden.
Running pnpm run dev
much more works than running pnpm run build && pnpm run preview
. @vishalxl is working on this with partial success so far in his master branch.
Branch eose
has nostr-tools switched from an npm dependency to using a git submodule to make modifications to it and implement end-of-stored-events nip-15 which was merged upstream already but not published to npm yet.
Either way, that branch as of now does not work using pnpm run dev
in Chrome (and due to workers not working in FF anyway, certainly not in FF neither) and triggers a reload-cycle without "pausing" even if in the dev console the pause-on-exception option is set. I don't know what's wrong but suspect it's due to some packaging options that apply differently for pnpm run build
than to pnpm run dev
as with pnpm run build && pnpm run preview
the page works with these modifications.
Currently the Profile page (/<pubkey>
) is very debuggy. It should more resemble Astral or Twitter, featuring properly rendered Text Notes, Follows, Followers (from in-group), ...
While the requested event, the root event or the replied to event is loading, show a placeholder empty TextNote with a "loading ..." indication.
If loading from DB fails, load from network #62.
If loading from network fails, mark as missing.
Let the user create a new thread / Text Note. This probably comes before #10
The current layout is the SvelteKit "Hello World" app. This needs to be turned into a mobile friendly layout, so that on small screens elements get arranged differently than on the big screen.
Astral does a good enough job here. As always, Twitter would be the primary reference.
When running with pnpm run dev
things work fine in Chromium but for known reasons not in Firefox.
When running with npm run build && npm run preview
or pnpm run build && pnpm run preview
, it silently fails to load events on Firefox and on Chromium it crashes with:
ReferenceError: global is not defined
in http://localhost:4173/node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-node-polyfills/polyfills/util.js
This thread shows me four events:
When selecting the root event, no replies are shown at all.
Now when opening this event, I don't see above's root event but when I select its reply, I see it.
This event also looks like a root event but is certainly a reply. If the event replied to is missing, which I assume is not the case here, it should still be hinted at.
When opening a specific chat, nostroid "randomly" jumps back to the list of chats. I suspect this happens when an event or a DM event is received.
Currently, clicking avatars in the thread view for example is equivalent to clicking anywhere else in the textNote. It should link to the user profile or open a context menu like on twitter on hover.
Link to profile page is MVP
Context menu on hover is MVP+1
Whenever an event is queried by ID from the DB and this fails, the event should be queried from the network.
For example when follows reply to something, the thread view should show that something.
Getting this error while trying to install exact versions of packages using pnpm install --frozen-lockfile
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
In CI environments pipelines will fail, if configured to use pnpm, because this setting is true by default. You can still install exact versions of dependencies through npm using npm ci
, because package-lock.json is in sync with package.json.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.