Menu

Our app says: the site didn't say, so we assumed. Then it rings the field each assumption is about
📰

Our app says: the site didn't say, so we assumed. Then it rings the field each assumption is about

DEV Community: react·Daniel Pertu·10 days ago
#WsFPdrd6
#devtoreact#devto#dev#panel#part
Reading 0:00
15s threshold

When software writes a document for you, the hard part is not writing it. It is telling you which bits it made up.

Nakodo starts a campaign by writing a brief, which how it works describes with the line that matters here: everything in it can be changed before anything happens. A brief written from a website always contains guesses, because websites do not state everything, and the app keeps those guesses alongside it. The question is what the screen does with them.

The answer is 133 lines, a panel above the document and a ring around the fields inside it, and most of the decisions in it are about not nagging.

One state, two places, no prop drilling

The panel is at the top of the page and the marks are deep inside an 859-line form, so both read from one context:

type Marks = Map < BriefPart , string [] > ;

const Marked = createContext < { marks : Marks ; mark : ( guesses : Assumption []) => void } > ({ marks : new Map (), mark : () => {}, });

Enter fullscreen mode

Exit fullscreen mode

The default…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.