Expand description
How it is tested, what is not, and every test by name. Documentation only.
- How much
- Where the tests are
- What a test is named
- What the tests stand on
- What
just checkholds to - Fuzzing
- What is not tested
- Trying it by hand
- Every test
§How much
433 tests in 58 modules.
The number is counted from the sources when the crate is built (see
build.rs), so it is the number there are. Two of them are held
against the real system keyring, with throwaway keys that are taken
out again however the test ends: they run wherever a keyring answers,
and have nothing to hold to where none does.
just test # all of them
just check # everything else that is held to: see below
just coverage # which lines the tests run, as pages (cargo-llvm-cov)
just fuzz # what reads untrusted input, fed whatever a fuzzer makes up§Where the tests are
Every test is beside the code it tests, in a tests module at the
foot of the file. There is no tests/ directory: what is tested is
mostly not public in any sense that matters, and a test beside the
code can reach what is private to it.
flowchart TB
subgraph pure["Pure: something in, something out"]
events["Events made and read: compose, content, thread, feed, bookmarks, contacts, relay lists, drafts"]
choosing["Choosing: which relays, which rank, what was typed"]
layout["Layout: row heights, the virtual list, what a picture takes"]
end
subgraph inprocess["Against something real, inside the test process"]
relays["The relay client, against relays run in the test"]
signer["Signing in, against a remote signer run in the test"]
lmdb["The event store, in a directory of its own"]
end
subgraph outside["Against the machine"]
keyring["The keyring round trip: wherever a keyring answers"]
end
pure --> inprocess --> outsideMost tests are of the first kind, because most of the code is: the
modules that make and read events do no I/O (see
crate::guide::protocol), so they are tested by giving them an event
and looking at what comes out.
| What | How it is tested | Where |
|---|---|---|
| Making events: notes, replies, comments, quotes, lists, drafts | The unsigned event is built and its tags looked at | crate::nostr::compose, crate::nostr::contacts, crate::nostr::bookmarks, crate::nostr::relay_lists, crate::nostr::kept_drafts |
| Attaching a file: what a picture’s file is left with, the server list, the authorization | Files are put together in the test with everything a camera and an editor leave in them, made bare, and decoded | crate::media, crate::nostr::blossom |
| Sending a file to media servers | Servers that listen on this machine, each behaving its own way: taking the file, refusing it, not knowing the question, reading the authorization the old way, changing the file | crate::nostr::blossom |
| Reading events: text taken apart, threads put in order, counts | An event is made and signed in the test, and read | crate::nostr::content, crate::nostr::models, crate::nostr::thread, crate::nostr::engagement |
| Lists that stay put: what waits, what joins up, what leaves a hole | Pages are offered to a list, and what it shows looked at | crate::nostr::feed |
| Which relays are asked | The plan for given people and lists | crate::nostr::outbox |
| The relay client: reading, publishing, lists changed safely | Against relays started in the test | crate::nostr::client |
| Signing in three ways, signing, encrypting | Against a remote signer started in the test | crate::nostr::account |
| The store letting go of what is old | Events saved, swept, and counted | crate::nostr::sweep |
| What is fetched from the web: caps, what is read of a page | Parsing, with no network | crate::http, crate::previews, crate::nostr::nip05, crate::nostr::zap, crate::nostr::relay_info |
| Pictures: the budget, the shapes, what is dropped first | Pictures made in the test | crate::images |
| Rows: how tall one is estimated, against how tall it measures | Rows laid out without a window | crate::views::components::note_row |
| The list: which rows are built, where they sit, what a jump does | The arithmetic of the list, without a window | crate::views::components::virtual_list |
§What a test is named
A test is named for what it holds to be so, as a sentence:
a_note_the_store_let_go_of_is_asked_of_the_relays_again,
a_list_that_cannot_be_read_is_not_written_over,
the_estimate_is_close_to_the_measured_row. Not for the function it
calls, and not test_ anything.
Read one after the other, the names are an account of what the code is held to, which is how the list at the foot of this page is meant to be read. A name that can’t be written as a sentence that is true or false is usually a test of nothing in particular.
A test that fails says which sentence stopped being true.
§What the tests stand on
Nothing outside the test process, but for the two keyring tests. Each test that needs one makes its own, and takes it away after:
flowchart LR
test["A test of the relay client"] --> helper["with_relays: so many relays, and a client whose own relay is the first"]
helper --> relays["LocalRelay, on a port of this machine, in this process"]
helper --> store["An event store in a temporary directory named for the test"]
helper --> client["A NostrService that takes anyone's word for a relay"]
client --> relays
client --> store- Relays.
nostr-sdkhas a relay that runs in-process, the same one Avestruz runs for its drafts. A test ofcrate::nostr::clientstarts as many as it needs, puts events on them, and asks the client what it finds. What is asked of which relay is then a fact that can be looked at: which relays are in the pool afterwards, which relay holds what was published. - A remote signer. The tests of
crate::nostr::accountrun a NIP-46 signer in the test, over one of those relays: one that agrees, one that refuses, one that will not decrypt. - An event store. A real LMDB store in a temporary directory with the test’s name and the process’s id in it, removed when the test is done.
- Time. What depends on when an event was written is given events written at chosen times. Timeouts in the client’s tests are the real ones, which is why a few of those tests take a second or two.
The client’s real rule about which relays may be connected to would
refuse every relay a test can start, since they are all on this
machine. So the client takes that rule as a value
(Reach), the tests give it one that
accepts anything, and the rule itself
(public) is tested on its own.
§What just check holds to
Not everything that is held to is a test. just check runs, in
order:
| Step | What it holds to |
|---|---|
cargo fmt --check | One way of laying the code out (rustfmt.toml) |
cargo clippy, warnings denied | Nothing in src/ that can panic, no dead code, no wildcard imports (see crate::guide::decisions) |
cargo test --no-run | That the tests compile, which clippy, run without them, doesn’t see |
cargo machete | No dependency that isn’t used |
cog check | That every commit since the last release is a Conventional Commit, of a type the release notes have a section for (cog.toml, cliff.toml, CONTRIBUTING.md) |
just doc | That the documentation builds, with no link that leads nowhere |
just mermaid-check | That every diagram in it parses |
cargo deny | No dependency under a licence the project can’t take |
cargo audit | No dependency with a known vulnerability; what is only warned of is listed in the justfile, each with why it is there |
The tools that are not part of Rust are skipped, with a line saying so, where they are not installed.
On GitHub every push to main, and every pull request to it, is put
through just check and just test (.github/workflows/ci.yml),
with all of those tools installed, so that nothing is skipped there.
A second job measures coverage. The two tests of the system keyring
find none on a runner and hold to nothing; the rest run as they do
here.
§Fuzzing
A test holds a parser to the inputs somebody thought of. What reads
what a stranger sent is also held to the ones nobody did: just fuzz
feeds each of these whatever cargo-fuzz
makes up, for a minute each, and a panic, or anything the address
sanitizer catches, fails it and leaves the input that did it under
fuzz/artifacts/.
| Target | What it reads | Whose it is |
|---|---|---|
note_content | A note’s text, the Markdown in it included, and an imeta tag (parse_attached, runs, imeta) | Anyone’s who writes a note |
link_preview | The head of a linked page (previews::parse) | Whatever server a note links to |
relay_info | The document a relay says what it is in (relay_info::parse) | Any relay’s |
attached_file | A file to attach, taken apart to leave out what it says beside the picture (media::prepare) | Whoever made the file |
youtube_link | A link that may be to a YouTube video, and what a video is called (video_at, title) | A note’s author, and YouTube |
just fuzz # every target, a minute each
just fuzz note_content # one target, for a minute
just fuzz note_content 0 # one target, until it is stoppedIt takes a nightly toolchain (rustup toolchain install nightly) and
cargo install cargo-fuzz, and is no part of just check: it builds
the whole program a second time, with the sanitizer in it. The targets
are a crate of their own in fuzz/, with its own lock file, which
holds the dependencies to the versions the program is built with.
What a fuzzer has found so far it keeps in fuzz/corpus/, on the
machine it ran on: it starts from nothing on another. Decoding a
picture is not among the targets: that is the image crate’s, which
is fuzzed where it is made.
§What is not tested
- The views, as pictures. Nothing renders a view and compares it with anything. What is tested of them is their arithmetic: how tall a row is, which rows a list builds.
- The handlers. They are thin on purpose: what a handler decides
is mostly in a function of
crate::nostror of the state, which is tested. The handlers themselves, and the order messages arrive in, are not. - Real relays, real signers, a real wallet. The relay in the tests is one implementation, and a patient one.
- The panel. Whether the popup opens where it should and closes when it should is the desktop’s doing.
- Anything over the network: pictures, link previews, NIP-05, LNURL. Their parsing is tested; their fetching is not.
- Videos from the web, and their sound. The tests play a second of a test picture from a file, through the same pipeline, where GStreamer and the elements for it are installed, and pass for nothing where they are not. Fetching one, the formats notes really link to, and what is heard are tried by hand.
- Fonts. What a font file is told to have of colour glyphs and of emoji is tested, on files made for the tests, and so is which fonts are then put first. What the fonts of a system draw of an emoji is looked at by hand.
- yt-dlp, and YouTube. Which links are videos, what is handed to yt-dlp and how what it writes is read are tested. Running it is not: whether it finds a video depends on the day, the machine and where the machine is.
§Trying it by hand
What the tests don’t reach is tried by running the applet against a relay on this machine, with a config and a store of its own, so that nothing of the real account is touched:
# A relay to talk to (https://github.com/fiatjaf/nak).
nak serve --hostname 127.0.0.1 --port 10999 &
# A throwaway account, someone for it to follow, and something to read.
key=$(nak key generate) other=$(nak key generate)
nak event --sec "$other" -c "hello" ws://127.0.0.1:10999
nak event --sec "$key" -k 3 -p "$(nak key public "$other")" ws://127.0.0.1:10999
nak encode nsec "$key" # what to sign in with
# A config that names only that relay, and a store nobody else uses.
export XDG_CONFIG_HOME=$(mktemp -d) XDG_DATA_HOME=$(mktemp -d)
config="$XDG_CONFIG_HOME/cosmic/io.github.cosmic-applet-avestruz/v1"
mkdir -p "$config" && printf '["ws://127.0.0.1:10999"]' > "$config/relays"
# Outside the panel the button is a small window of its own; the popup opens by the screen's edge.
RUST_LOG=cosmic_applet_avestruz=debug just runSigning in with an nsec there writes to the real keyring, under the
throwaway account’s npub: sign out again, or remove it with
secret-tool clear service cosmic-applet-avestruz username <npub>.
A relay on this machine is used whatever the account’s relay list
says, which is what makes this work: see crate::guide::relays.
§Every test
433 tests in 58 modules.
§button
- Toggle said at the socket is heard by the window and nothing else is
- A window leaves the socket to the one that listens and takes it when that one is gone
- A window whose socket file was taken away listens anew
- With no socket to listen at nothing is heard
- The window says whether there is something not looked at
§drafts
- Each target has its own draft and a blank one is none
- The draft of a note is there after a restart until it is blank
§emoji
- An emoji is known however it is written and nothing else is
- The most used are offered first and the usual ones fill the room
- What is no emoji is not kept and only so many are
- An emoji is found by what it is called or in its group
§fonts
- A font with only gradient colour glyphs cannot be drawn
- A font has emoji if it has a glyph for one
- A file that is no font says nothing
- Emoji are looked for in colour first and in the applets own font before the systems
- The fonts for emoji come before the platforms and the rest is the platforms
§handlers::compose
- What goes out is the text without the space around it and a quote names its note
- What is looked at takes the notes found for it only while it says the same
- Backspace leaves an empty composer and asks before leaving one with something in it
- A backspace held down to rub the text out is not one that leaves
§handlers::images
- A copied picture is a picture to what takes pictures and its address to what takes text
- A paste gets the picture itself once it has come
- A paste gets what was shown of a picture that does not come
§handlers::keys
- The keyboard goes through the ways a repost menu offers and no further
- Space plays a note whose first link is a video and opens any other first link
- A step puts the next note or the one before at the top of what is in view
- The row stepped to is the one that is marked
- From a marked row a step is to the row beside it wherever the list can scroll to
- Home goes to the very top from anywhere but there and marks nothing
- The keyboard is at the marked row while the list is about where it is
- With nothing marked the row opened is the one at the top of what is in view
- On a page whose list is under something the top is a place and the rows follow it
§handlers::media
- What is pasted is files before text and text before a picture
- What was on the clipboard is text files or a picture
- Why a file was not attached names the file and each server
§handlers::navigation
- The popup is put by the panels edge at the end the button is in
- The button is in the part of the panel that lists it
- The popup may be as tall as its screen has room less a gap at either end
- A screen not measured yet gets a popup that fits any
- A very short screen still gets the least a popup asks for
§handlers::screenshot
- A picture is called after when it was taken
- A picture is written as it came transparency included
- A picture that is not the size it says is not written
§handlers::zap
- A wallet is given the invoice as an address in capitals
§helpers
- A size is said in the unit that keeps it short
- A count is cut to what fits beside an icon
- A time reads in the largest unit that fits
- A time ahead of the clock reads as now
- Long text is cut on a character and marked
§http
- A web page is what the server calls one
- A video is what the server calls one
- The head of a page ends where it closes or the body opens
- One tls provider is compiled in
§images
- A picture not there is asked for once
- The same address in another form is another picture
- A picture that failed is not tried again
- Only so many load at once and the rest ask again
- Over budget the pictures least recently shown go first
- A picture larger than the budget is still shown
- A picture is decoded from its bytes
- A picture is kept at the size it is shown at and laid out by its own
- The other shapes are made no larger than they are ever shown
- What is behind a see through pixel does not darken what is made smaller
- The budget counts the pixels kept not the pictures own
- A picture that would decode too large is refused
- Bytes that are not a picture are refused
- An avatar is the middle square made round
- A strip is the middle of the picture three times as wide as tall
- A thumbnail is the middle of the picture in its own proportions
- A picture for the clipboard is a png the way up it says it is
- What is shown of a picture is a png of the pixels kept
§links
- Only web addresses are opened
§media
- A file is known by how it starts and failing that by its name
- Which way up is read from exif written either end first and written back alone
- A jpeg keeps its picture its colours and which way up and nothing else
- A jpeg that is upright as written says nothing beside the picture
- A jpeg that is not put together as one is not a picture to send
- The checksum of a png chunk is the one a png ends with
- A png keeps its picture its colours and which way up and nothing else
- An animated png stays animated
- A png that is not put together as one is not a picture to send
- A webp keeps its picture its colours and which way up and nothing else
- A webp that is only the picture is left as it is
- A picture is made ready bare and measured as it shows
- What cannot be made ready is refused and says why
§nostr::account
- What was encrypted the old way is told from the new
- What an account encrypts to itself only it reads back here or at its remote signer
- A remote signer that will not decrypt is an error
- A remote signer signs as the account whose key it keeps
- A session is only for the account it is expected to sign as
- A signature the remote signer refuses is an error
- A signer that says no is reported with the key it would have to know
- A sign in waiting on a remote signer can be called off
- A secret key is kept in the keyring until sign out
- A bunker account signs through what the keyring keeps until sign out
- What the keyring keeps reads back as it was written
- An nsec signs in with full access and an npub read only
- A bunker address signs in through the signer and relays it names
- A pasted key may carry spaces or the nostr scheme
- Anything else is refused with the reason
§nostr::blossom
- A server is typed with or without its scheme and is the root of its domain
- A server list is written with its servers in order and the rest as it was
- An upload is authorized for one file and for a while
- A note says of a link what is at it
- A file goes to the first server and the others fetch it from there
- A server that would not take a file is not sent it and the next one is
- A server that does not know the question is sent the file
- A server that reads the authorization the old way is asked again that way
- When no server takes a file each says why
- A file the server changed is another file and no other server is asked for it
§nostr::bookmarks
- What a list keeps to itself is tags as compact json
- Only a note the list keeps to itself is bookmarked
- The notes are listed from the last bookmarked each once
- A bookmark is added to what is kept private after the others
- A bookmark says where its note is when it does
- The first bookmark of an account with no list is a list of one
- Taking a bookmark off takes the note out of what is kept private and nothing else
- A changed list is a newer bookmark list with the tags of the one it replaces
§nostr::client
- A thread is the root what names it and what names those
- A thread reaches for the parents that nothing else brought
- A thread of comments is what they are about and the comments under it
- What was made of a note is counted from the store which the relays fill
- A page comes with the notes its notes quote and the store keeps them
- A note is seen on the relays that have it and on those that took it
- The relay that has an event is the one pointed at
- The receipt of a zap is waited for and then counted
- A published event is kept once a relay took it
- An event no relay took is not kept and says why
- Notes named by id come in the order they were named from the store or the relays
- A note the store let go of is asked of the relays again
- Notes are read from the relays their authors write to
- No more of other peoples relays are reached for than may be
- A relay on this machine is not connected to on somebody elses word
- A relay that does not connect is left alone and the others still asked
- A profile the accounts relays do not have is asked of where its person writes
- A quoted note is asked of where its address says it is
- A search asks the accounts search relays and no others
- A thread opens on a note that is only where its address says
- A listed note is asked of the relay it is said to be on and of where its author writes
- A thread is asked of the relays of those whose conversation it is
- The configs relays stand down once the account says where it writes
- What the account writes goes to the relays its list names and to those it is meant for
- The newest list is the one that counts
- The accounts relays are read from its lists and changed as another client left them
- A first relay list is only written after saying so
- The accounts media servers are its list and a first one is only written after saying so
- Listed relays that cannot be read are not written over
- What the accounts relays do not have is looked up where its list says
- A blocked relay is never connected to on anyones word
- A draft is kept on the relay of this machine and on no other
- A bookmark is one change to the list another client wrote
- The first bookmark list is only written when the account says so
- No first list is written while a relay that may have one does not answer
- A list from an older client is read and written back the new way
- A list that cannot be read is not written over
- What decrypts to something else than tags is not a list to change
- A note nobody has has no thread
- A list of authors is asked about in one filter for every so many of them
- A feed filter names its authors its page and only notes and comments
- An author who published twice is known by the later profile
§nostr::compose
- A note goes out as written with no tags it did not ask for
- Mentions and hashtags are tagged each once
- What is written as code is not tagged and what is stressed is
- A reply to a note that starts a conversation names it as the root
- A reply further down names the root the parent and everyone spoken to
- Replying tells nobody twice and not oneself
- An answer to a comment is a comment under what the comments are about
- A comment on an article names it by its address and its id
- An answer to a text note is never a comment
- A quote names the note in its text and its tags and tells its author
- Quoting tags each note once and tells nobody twice nor oneself
- A reply that quotes is a reply still
§nostr::contacts
- Following adds one person and keeps everything else
- Unfollowing takes one person out however often they are in
- Nothing is written when nothing would change
- A first list follows the one person
- The new list is newer than one that claims to be from the future
- A list names each person once and may name nobody
§nostr::content
- Plain text stays one piece with its line breaks
- A link is labelled by host and path and keeps its address
- What a note marks is set so and read for links and hashtags like the rest
- Code is shown as written and read for nothing
- A link the note labels says its label and where it goes
- A note cut inside what it marks is cut as any other
- A table stands apart and its cells are read as the text is
- A table is shown whole or not at all and code as far as there is room
- What stands apart reads as words where there is one line for a note
- A long link gets a short label
- Only web links are links
- People are mentioned by key whichever way the key is written
- Another note is referred to by the start of its address
- Hashtags lose their hash
- A long note is cut at the limit and marked
- A note that is cut keeps all of its text beside what is shown
- A link is shown whole or not at all
- An empty note has one empty line
- A picture is set aside and leaves no gap in the text
- Only what can be fetched and decoded is a picture
- A picture after the cut is still shown and only so many are
- The last page a note links to is the one previewed
- The first link of a note is its first that is no picture
- Imeta tags say what a link is
- Imeta tags give pictures their size
- A video is set aside as a picture is
- A youtube link is a video and no page to preview
- A link the note calls a video is one whatever its address
§nostr::engagement
- Who reposted a note is each of them once the last first
- Who reacted to a note is each of them with what they reacted with last
- Who zapped a note is each of them with all they paid the most first
- Each note is counted by the events about it
- A reaction is to the last note it names
- A reaction counts as one for the note and its author hears of it
- A reaction is an emoji if it says one and a like if it says anything else
- The accounts own reaction is the one it made last
- A repost of a note carries it whole and says where it is
- A repost of anything else says what kind it is
- A note that was to stay where it was sent is reposted by name only
- A mark is counted once and taken back once
§nostr::feed
- A note that comes again with what it quotes is shown with it
- A page is its newest notes each once
- Notes of the same second keep one order
- Merging keeps the feed newest first and skips known notes
- Merging reports the people new notes mention too
- Replies show among the notes or not at all
- Merging nothing new reports no authors
- Notes a list does not have wait and the list stays as it is
- A note that arrives late waits too
- A full page that stops short of the list is detached from it
- A page that reaches the list joins what waits to it
- What waits is counted as the list is read
- Only so many notes wait
- A note of ones own waits with the rest
§nostr::kept_drafts
- Each thing written to has a draft of its own
- A draft is the note it would be and reads back as its text
- A draft keeps what it says of the files it links to
- A draft wrap says which draft it is and replaces the one before
§nostr::markdown
- A note that marks nothing is one run of itself
- Marks inside words are not marks
- Faces made of marks stay faces
- A backslash before a mark keeps it from being one and goes
- What is marked is set as marked without its marks
- Marks inside marks add up
- Marks beside text written without spaces are marks
- Code is as written whatever is in it
- What is between two fences is code that stands apart
- A heading is bold and says how deep and a hashtag is not one
- A line with equals signs under it is a heading
- What is quoted is quiet behind a bar
- Items of a list get a dot and a dash alone does not
- What is to do gets a box ticked or not
- Three marks alone on a line are a rule that stands apart
- Lines of cells with a line of dashes under the first are a table
- A table says where its columns stand and reads its cells as text
- A line with a bar in it is not a table by itself
- A labelled link is a link that says its label
- An address between angle brackets is shown without them and a br is a line break
- What is in a web address is not a mark
- Line breaks written as two characters are kept where nothing is marked
- A note of nothing but marks is read in the time any other is
- Marks inside marks are followed so deep and no deeper
§nostr::models
- What is being written reads as the note it would be
- Marked tags say what a note replies to
- Unmarked tags say it by position
- Tags that name no event are passed over
- A feed row cuts a long note and its own view does not
- A note is shown with the first few notes it quotes that are at hand
- Someone goes by their profile name or else their short key
- A comment answers what it names in small letters under what it names in capitals
- Only notes and comments reply to anything
- A profile prefers the display name and skips blank ones
- A profile picture is kept only if it can be fetched
- A profile banner is kept as its picture is
- A profile says which name its author claims
- A profile says where its author can be zapped
- A profile says what its author says of themselves up to a length
- A profile website is kept only if it is a web address
- Content that is not a profile gives an empty one
- A short npub keeps both ends
§nostr::nip05
- A name at a domain is told from a word and from a domain
- A name is asked of its own domain and nowhere else
- A name shows whole and the domains own name as the domain
- A name is someones only if the domain gives their key for it
§nostr::notifications
- What a note tells is read off what it says and what it answers
- A reaction or a repost is told when it is to a note of the accounts
- A zap is told as its receipt has it and shown when the accounts wallet signed it
- They are kept newest first each once under its tab and the new ones are counted
- The question names the account and the time it is about
§nostr::outbox
- A relay list says where someone writes and where they read
- Only an encrypted relay on the open internet is connected to on somebody elses word
- The relays that have the most people are taken first
- The plan the guide works through is the plan that is made
- Relays long unused are let go of and the least used when there are too many
- The accounts own relays count and are not taken again
§nostr::private_relay
- The relay is reached from here and leaves nothing to open
§nostr::relay_info
- A relay is asked what it is at its own address
- What a relay says of itself is its name a line about it and what it supports
§nostr::relay_lists
- What a relay says of itself gets in the way of some sets and not of others
- A relay is typed with or without its scheme
- Relays are added once taken out and moved
- A relay list is written with each relay marked for what it is for
- Listed relays are those said to anyone and those kept private
- A listed relay stays where it was and a new one goes where the list keeps them
- A first list says its relays or keeps them as its kind does
§nostr::search
- An address is opened and a secret key goes nowhere
- People are searched by their profiles and notes by what they say
- The people followed come before the others who go by the same name
- The answers of several relays are taken a rank at a time
§nostr::share
- A share link is a web address that names the note and where it is
- A share link names no relay only this machine can reach
§nostr::sightings
- A note is seen on every relay that sent it each once
- Relays past what can be told apart are not kept track of
§nostr::sweep
- What is old and can be asked again is swept
- A sweep goes through more than a page
§nostr::thread
- Every note sits under the one it answers oldest answer first
- A note whose parent is unknown goes under the root or else to the top
- A thread starts with its note if that is at hand
- Merging replaces a known note and reports only the people of new ones
- Answers of the same second keep one order
§nostr::zap
- An invoice says what it asks for
- A lightning address is asked at its domain over https
- An address says what it accepts and whether it does zaps
- An answer that is not lnurl pay is no answer
- A zap request names the note its author the amount and where the receipt goes
- An invoice is asked for with the amount and the signed request
- A plain payment carries its comment only if the address takes it
- An invoice is only taken if it asks for what was chosen
§previews
- A page is shown as it says it wants to be shared
- What is meant for sharing is taken before what is not wherever it stands
- A page with only a title is called by it
- A page that gives itself no title has no preview
- Only the head is read and what is written in a script is not a tag
- A picture that would not be fetched is left out
- Long texts are cut and garbled ones dropped
- A page is asked about once whatever it answers
§requests
- What is asked for often is asked for once and fetched once
- Only so many are on their way at once and the rest ask again
- A request that does not fit the queue is asked again later
§screen
- A surface as tall as its screen has room says how tall that is and at what scale
- A surface not laid out yet is no answer rather than a wrong one
§state
- A note shows in full from when it is asked to until it is asked not to
- A note says of the files it links to in the order it links to them and of no others
§video
- A video has the whole width and is never taller than wide
- Time reads as a player says it
- How loud is shown as a mixer shows it
- The mute button says how loud and the slider unmutes
- The slider of the sound shows under the pointer and while it is dragged
- A youtube video is on its way until what there is to play of it is found
- A speed is chosen from a few and holds for the next video
- Only an https address is played
- A video no row shows is held and one that is shown plays on
- Pressing play holds the video that plays and starts any other
- Frames come as rgba scaled down to fit and in their own proportions
- A video plays faster or slower as it is told and seeks at that speed
- A video plays to its end and can be played again
§views::bookmarks
- A page keeps what it found until the bookmarks are others
- The end of the bookmarks says what is not shown
§views::components::avatar
- A key always gives the same colour and one white reads on
§views::components::media_placeholder
- A picture is as wide as the room there is and never larger than it is
- The placeholder is as large as the picture will be
§views::components::note_row
- A click on a mention or a link leads where it says
- A note being written shows whole and without what a row ends with
- A note is as wide as its row
- Larger text makes a taller row
- A longer note makes a taller row
- A very long note is cut in the feed
- A row keeps its height when the preview of its link arrives
- A page with nothing to say gets no card and leaves no gap
- A click on the preview opens the page and not the thread
- A video has the same room before while and after it plays
- A click on a video plays it and its bar does what it says
- A youtube video has a videos room whatever is known of it
- A link that turned out to be a video offers to play it and then has a videos room
- A right click on a count asks who they were and they are listed under it
- The repost action opens a menu that reposts or quotes
- The bookmark action is at the right of the line and stays there when the relays come
- The share action is beside the bookmark and says when it has copied
- The line of actions has room for all of them at every size
- A note shows as bookmarked as the change on its way will leave it
- A quoted note shows as a card when it is at hand and as a link when not
- A click on a quoted note opens its thread and not the one of the note quoting it
- A relay is called by its address without the scheme
- A row is as tall with counts under it as without
- The heart offers what to react with and an emoji pressed reacts
- An open menu and the relays a note was seen on take no room in its row
- A picture reaches from one edge of its row to the other unless it is narrower itself
- A row keeps its height when a picture of known size arrives
- A click on a picture opens the note as one on its text does
- A picture that failed leaves a link and no gap
- The estimate is close to the measured row
- A link in a cell of a table can be clicked
- What stands behind code takes no room
- A long note has a button under its text that shows the rest and one that shows less
- The button under a long note takes its room and no more in full
- The row of a note in full keeps how far its top is above what is in view
§views::components::notification_row
- A short row is exactly as tall as it is said to be whatever it says
- A note is under what it is to the account and as tall new as old
- A click on a short row opens the note it is about and who did it by their picture
§views::components::picture
- A picture takes a click with the right button and no other
- A picture is as wide as its row no wider than itself and in its own proportions
- A picture kept at the size of its room is drawn pixel for pixel
§views::components::qr_code
- A code is square dark on white with room around it
- A longer text makes a larger code and too long a text none
§views::components::scroll_position
- It takes no room and keeps how far the scroller is scrolled
- What is under something in a scroller knows how far down it is however far that is scrolled
- A new scroller starts where the last one was left
- A long list makes the popup as tall as it may be and a short one as tall as itself
- A new scroller that was never scrolled starts at its top
§views::components::table_grid
- A table that fits is as wide as what it holds
- A table that does not fit is as wide as the room and wraps what it holds
- Columns that fit are as wide as what they hold
- Columns that do not fit share the room the narrow ones first
§views::components::virtual_list
- Rows sit under one another at their own heights
- A row asked to be measured anew is measured by the next layout in view or not
- Rows not yet seen are as tall as their estimate
- Scrolling down never moves what is on screen
- Jumping far builds only the rows that land in view
- A jump lands on the same rows however many frames follow
- Rows added at the front leave the others measured and in their state
- Measurements outlive the widget tree
- Nearing the end is told once for each place and never while redrawing
- Rows are as tall together as measured or else estimated
- Another width measures again
- An empty list has no height and builds nothing
§views::compose
- The frame of what is written is as tall as what it holds within its bounds
- A note in brief is one line with names and labels
§views::thread
- A row is as tall set in or picked out as it is plain
§youtube
- A youtube video is known by its id however its link is written
- What is not a video is not one
- Only what is shaped like an id is one
- A video has two pictures to stand for it the better first
- Youtube says what a video is called
- A stream is waited for until youtube says it is good
- What yt dlp writes is read for a stream or for what went wrong