Sub topic 7
Building the screens
This chapter assumes you have a scoped core flow and a data model, covered in the earlier chapters on scoping and data modeling. Here you turn them into screens: which pages exist, what each one shows, and how a builder binds them to your data. The running example is TaskNest, the freelancer task tracker.
Start from the flow, not from the canvas
Every screen should exist because a step in the core flow needs it. For TaskNest the flow is: sign in, create a task, see your own tasks, mark one done. That gives you three screens and no more:
- A sign-in screen.
- A list page that shows the user's tasks.
- A create-task form, either on the list page or as a dialog over it.
Anything else (settings, profile, a dashboard with charts) belongs to a later version. Each extra screen adds data bindings, states to handle, and things to test.
Sketch each screen on paper or in a text list before you open the builder. For every screen, write down four things: its purpose, the data it reads, the data it writes, and the action that leaves it.
| Screen | Reads | Writes | Leaves by |
|---|---|---|---|
| Sign in | Nothing | Session | Redirect to the list |
| Task list | Tasks where owner_id is the current user | status on one task | Opens the form |
| Create task | Nothing | One new task row | Returns to the list |
If a screen has no row in this table that justifies it, remove it.
The three building blocks
Most builders, whether no-code platforms or AI app builders, describe a screen with the same three ideas.
- Components are the visible pieces: text, buttons, inputs, lists, tables, dialogs. You place them or ask the builder to.
- Data bindings connect a component to your data. A list component is bound to a query on the tasks table. A text field inside a list row is bound to one column of that row.
- Actions run when something happens, such as a button click or a form submit. A typical action is "create a row in tasks with these field values, then navigate to the list."
Most screen problems come from bindings and actions, not from layout. A page that looks right but shows the wrong rows has a bad binding.
Design for the states a screen can be in
A screen is rarely just "showing data." Each data-bound screen has at least four states, and builders usually show only the happy one by default.
- Loading: the query has not returned yet. Show a placeholder or spinner.
- Empty: the query returned zero rows. A new user sees this first, so give it a message and a button, such as "No tasks yet. Add your first task."
- Error: the query or action failed. Show a message and a way to retry.
- Populated: the normal case.
The empty state matters most for an MVP, because every new user starts there. Test it with a fresh account, not with your own seeded data.
Forms and validation
The create-task form is where bad data enters. Apply checks in two places.
- On the screen: mark title as required, use a date picker for due_date, and use a dropdown for status limited to todo, doing and done. This gives fast feedback.
- In the database: the schema from the data modeling chapter already has
not nullon title and acheckconstraint on status. These catch anything that bypasses the screen.
Screen checks are for the user's convenience. They are not protection, because a request can be sent without using your form at all. Treat the database rules as the real ones.
After a successful submit, do three things: clear the form, give visible confirmation, and make the new task appear in the list. If the list does not refresh, the usual cause is that the list query was not re-run after the create action. Look for a "refresh data" or "invalidate query" option on the action.
Responsive layout and navigation
Many first users open an MVP on a phone. Check these before sharing a link:
- The layout stacks into one column on a narrow screen.
- Buttons are large enough to tap.
- Date pickers and dropdowns work with a touch keyboard.
- The user can always return to the main list.
Keep navigation to one place. With three screens, a single header with the app name and a sign-out button is enough.
Reuse instead of copying
If you paste the same header onto each screen, a later change has to be made three times. Most builders support reusable components or shared layouts. Define the header once and place it on every screen. The same applies to a task row: build one row component and let the list repeat it.
Using an AI builder for screens
When you prompt an AI builder, name the screens and their states, not just the feature. A vague prompt ("make a task app") leaves layout choices to the tool. A specific one constrains them:
Create three screens for TaskNest: a sign-in page, a task list page and a
create-task dialog opened from the list page.
The list shows only tasks where owner_id equals the signed-in user, sorted
by due_date ascending. Each row shows title, client_name, due_date and a
checkbox that sets status to done.
Include an empty state ("No tasks yet") with an "Add task" button, a loading
state, and an error message with a Retry button.
Layout must work on a 375px-wide phone screen. Use one shared header component.Then review what it produced against your screen table. Check that the list query filters by owner, that the checkbox writes to the database and not only to the screen, and that all four states exist. The next chapters on prompting and review cover this in more detail.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| List shows other users' tasks | Query has no owner filter and no database rule | Add the filter and a row-level security policy |
| Checkbox looks ticked but reverts on reload | The action changes local state only | Bind the checkbox to an update action on the row |
| New task missing until page reload | List query not refreshed after create | Re-run the query in the create action |
| Blank page for new users | No empty state, or a query that fails on zero rows | Add an empty state and test with a fresh account |
| Layout broken on phone | Fixed widths in the design | Use flexible containers and a single-column stack |
Exercise
A TaskNest user ticks the "done" checkbox on a task. It looks done, but after refreshing the page the task is back to "todo". Name the most likely cause and how you would confirm it.
Show answer
The checkbox is changing only the screen's local state and is not bound to an update action that writes status to the tasks table. To confirm, tick the box, then look at the row in the database (or the builder's data view). If status is still todo, the write never happened. Fix it by attaching an update action on the row that sets status to done.
Exercise
List the four states a data-bound list screen should handle, and say which one a brand-new user sees first.
Show answer
Loading, empty, error and populated. A brand-new user sees the empty state first (after a brief loading state), because they own no rows yet.