Root declarations: Read and Discuss
Every state, derive, resource, mutation and task that app.contract declares for the read and discuss packages, one line each.

This page lists the pkg:read decl and pkg:discuss decl blocks of the root contract. They sit together because discuss is drawn inside read's document screen and reads read's derives.

Read (lines 79-106)

Name

Kind

Meaning

readSiteDraft

state

Text typed in the open-site sheet

readSiteError

state

Error shown under that field

readSiteRevision

state

Bumped on every edit and every new sheet visit

readSiteSubmittedRevision

state

The revision that the pending submission was made at

readSiteReplyCurrent

derive

True when the sheet is on top and the two revisions match, so a late reply for an edited draft is ignored

readSiteOpened

mutation, ReadOpenReply, then readSiteAfterOpen

Validates the typed URL through readOpenSite. See Open a site by URL

readEpoch

state

Pull to refresh counter. A new value makes sources drop their caches

readTick

state

performanceNow() at the last minute tick, for relative dates

readClock

task, mount

every(60000, readClockStep)

dirQuery

state

Search text of the directory sheet

readStack

derive

All entries of the read tab's stack

readRefs

derive

The ref of each read or doc entry, "" for the site home

readContextRef

derive

The ref of the reader context: the last read, doc, or a thread opened with ?from=activity

readContextServer

derive

The server of the loaded page whose ref is readContextRef, else server

readVisible

derive

The top read entry only, so covered detail routes make no requests

dirUid

derive

The uid of a visible directory entry, else ""

authorUids

derive

The uid of a visible author entry

readCurrent

derive

uid or uid/path of the context document, used to check the current row in the directory

docs

resource readDocs(server, readRefs, readEpoch), DocPage[]

One page per stacked document. See Loading pages

directory

resource readDirectory(readContextServer, dirUid, readEpoch), DirPage

The space's document tree

authors

resource readAuthors(readContextServer, authorUids, readEpoch), AuthorPage[]

Author profile pages

All three resources use else empty(), so screens read a typed zero value while loading.

Discuss (lines 107-120)

Name

Kind

Meaning

discussEpoch

state

Pull to refresh counter for comments, added to readEpoch

discussDraft

state

Reply text in a thread

discussComposeDraft

state

Text in the compose sheet

discussReplyTo

state

Comment id the reply targets, "" for the thread root

discussTargets

derive

Refs of loaded documents on the context server, plus the ref of a visible comments or compose entry

discussThreadIds

derive

uid/comment of a visible thread entry

discussSignedIn

derive

currentAccount is set and its key is in meIds

discussAccountName

derive

Profile name, else key name, else short id of the current account

discussions

resource discussList(readContextServer, discussTargets, discussEpoch + readEpoch)

Comment listings per document. See Discuss: loading and posting

discussThreads

resource discussThreadList(readContextServer, discussThreadIds, discussEpoch + readEpoch)

Thread pages

discussPosted

mutation, DiscussReply, refreshes discussions, discussThreads, then discussAfterPost

Signs and publishes a comment

discussPostError

derive

error of the last post reply

Actions that write these

Read's actions are at lines 281-327 (readShowOpenSite, readEditSite, readSubmitSite, readSiteAfterOpen, readClockStep, readRetry, readRefresh, readDirRetry, readAuthorRetry, readOpenDir, readDirSearch, readDirClose, readDirOpen). Discuss's are at lines 328-365 (discussRefresh, discussRetry, discussEdit, discussEditCompose, discussSetReply, discussPost, discussAfterPost, discussCancelCompose, discussOpenCreate).

User stories

The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Connections0
Linked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkRoot declarations: Read and DiscussRoot declarations: Read aโ€ฆ
Citations 0Children & links 28

Loading child documentsโ€ฆ

Connections show where other documents or comments link to this document.

Related documents

Loading connectionsโ€ฆ