Giter Site home page Giter Site logo

giszmo / nostroid Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 11.0 1.81 MB

A fast cross platform nostr client that even works offline

Home Page: https://chat.nostr.info

License: Other

JavaScript 8.41% TypeScript 31.88% CSS 2.17% HTML 0.29% Svelte 57.18% Shell 0.07%
nostr

nostroid's People

Contributors

giszmo avatar louishuddleston avatar ralyodio avatar snuffydev avatar userquin avatar vishalxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nostroid's Issues

Feature: Implement Thread view

When selecting an event, show the full context:

  • The 5 Notes this was a reply to
  • Indicator if the first Note was not the start of the thread
  • Way to load more
  • Show the selected Note with slightly larger font
  • Show 10 replies, each displayed like beginning of a thread or in other words, not connected with lines or anything.
  • Show "load more ..." where the 11th would be
  • Each reply that itself has replies should indicate the number of replies
  • Show the most relevant first reply, connected with a line

Disable default accounts

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:

  • Remove default accounts
  • Console.log() what to run on the dev console to trigger adding them. No button needed.

Fix at times broken reactiveness

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?

Reduce Layout Shifts

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.

Replying in feed gets messed up with new messages coming in

Apparently feed items are sorted by index, so when replying to the second item, new events coming in result in my reply appearing under the formerly first item.

Screenshot from 2022-12-17 12-40-36

I did not feel comfortable sending my reply while it was visually under a different message.

Handle lack of IDB

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."

Feature: Let the user edit his follows

  • Make it easy to follow others
  • Wherever a profile is mentioned, following/unfollowing should only be one click away
  • User should be able to find his full list of follows under settings
  • Arrange with drag-and-drop (profiles are already sortable. Code is quite simple.)
  • Unfollow from list view
  • Store with delay like meta data

Fix Circular dependency - or at least make sure it's unproblematic

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?

Feature: Check nip05

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.

Pick a FOSS license

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.

Feature: Track "seen" state

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.

  • The Profiles tab should show counters (New notifications + conversations with new messages).
  • When selecting a profile, the Notifications and Messages tab should show counters of new notifications and conversations with new messages respectively
  • When selecting the Messages tab, each conversation should show a counter of new messages.

Feature: Subscribe to thread

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.

Feature: Implement Feed

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.

Feature: Allow editing relays

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.

Feature: nos2x/alby/nip07 support

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

  • Check if Alby supports DMs and works for Chrome and FF
  • If not, check the difference between nos2x for FF and for Chrome
  • Implement 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.

App appears to never download some events

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.

Feature: Reactions

  • Implement nip-25 reactions.
  • Only consider in-group. That means add reactions to the events to be loaded for all profiles that have degree < 100 and load reactions only from local IDB.
  • Show up to 5 most frequent reactions (3 👍 3 💯 2 ❤️ ... 15 reacted) on all notes
  • Show reactions like GitHub does.
  • Show only the last reaction of each user that reacted
  • Reacting should be possible like in GitHub, with a limited set of relevant emojis

Creating Profiles is broken

The recent changes to introduce a drag handle on the profiles broke profile creation. New profiles are only shown upon reload.

Feature: When switching accounts, construct in-group

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.

Feature: Send NIP-04 DM to any profile

  • On any profile add a ✉️ button to DM the user
  • In the Messages tab, implement the search box to show users from in-group matching the input even if there is no prior conversation with them

Keyboard interaction with mentions is broken

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.

Private key export

Allow exporting the account's private key on the settings page. By default it should be hidden.

  • Show priv key in hex on settings page. MVP
  • Clicking on a "show" button should reveal the hidden priv key. MVP+1
  • Hitting on "copy" button should copy it to clipboard. MVP+1
  • On mobile, the "copy" button should be a "share" button to allow avoiding the clipboard that is publicly available for all installed apps on Android MVP+2

Upgrade PWA plugin

Joaquín had helped Nostroid getting started by using what was back then a work-in-progress package. Apparently it is now fully available and we should switch to the official version and remove the gz file.

Screenshot from 2022-11-07 17-54-29

production build is broken

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.

Make nostr-tools work as submodule

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.

Feature: Add "public" channels

  • Add Anigma-style public channels
  • Mark as "hidden" if a message is not from in-group. Clicking it should show it anyway
  • Checkbox should allow to opt out from hiding messages
  • Out-group messages should still be easily distinguishable from in-group messages. Impersonators have to be obvious to the user as such

Feature: Make Profile page nice

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), ...

In thread view, show missing events with place holders

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.

Feature: Mobile Friendly Layout

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.

ReferenceError: global is not defined

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

Thread navigation is flaky

This thread shows me four events:

  • The supposed thread's root
  • The event itself
  • A reply
  • The reply's reply

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.

Make avatars and user names clickable

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

Fetch missing events from network

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.

package.json and pnpm-lock.yaml are not in sync

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.