All notes

Empty States Must Distinguish Absence from Uncertainty

Derive recovery actions from real response states, not an empty array used for everything.

English edition, edited for length. Read the complete Chinese original.

Why does the same blank space correspond to five different facts?

The shared directory page received an empty array and then displayed “Create the first document.” In reality, the request hadn’t completed, and the empty array was simply the initial value of the component. Another request was rejected due to permission revocation, but it ended up with the same array through an error. As a result, the same page translated all the states of waiting, rejection, and the actual empty array into a single sentence.

This document explores a state model based on a hypothetical document directory. It supports spatial switching, keyword and date filtering, pagination, and creation, but does not assume that the user has administrator privileges. The goal is not to design a more sophisticated blank illustration, but rather to ensure that each empty state clearly expresses the facts and only provides truly executable actions.

Use Response Status to Determine the Cause of Empty Pages

Separate the reading process from the success result. Only the success branch discusses whether the collection is empty; rejection and failure are not another success. Below is a local TypeScript model to illustrate the state relationships, not a complete network client.

type Scope = {
  workspaceId: string;
  keyword: string;
  from: string | null;
};
type DocumentItem = { id: string; title: string };
type DirectoryState =
  | { kind: 'loading'; requestId: number; scope: Scope }
  | { kind: 'ready'; scope: Scope; items: DocumentItem[];
      nextCursor: string | null; canCreate: boolean }
  | { kind: 'forbidden'; scope: Scope; canRequestAccess: boolean }
  | { kind: 'failed'; scope: Scope; retryable: boolean;
      correlationId: string };

ready Still doesn’t automatically indicate that the entire space is empty. The “empty” result may only correspond to the current filter and the current page. If the server doesn’t return global statistics, the interface can only say “No results found under these conditions,” and cannot fabricate “There are no documents here.” When querying global quantities for the initial use, consider factors such as permissions, costs, and the timing of the results, and avoid hiding assumptions within the components.

Types can prevent certain illegal combinations, but server data still requires validation at the entry point. A misspelled status, a missing cursor, or an untrusted permission field cannot be validated solely through type declarations. Status transitions are handled by the business layer, and shared empty state components only consume already-determined reasons, ranges, and actions, without interpreting any HTTP responses independently.

Creating, clearing, and applying permissions cannot be interchanged.

The keywords “migration” and the date “last day” do not have any matches. The primary action should focus on these two conditions. It is possible to remove the date or keywords, and to explain the scope of the impact before doing so. While directly clearing all filters is easy to implement, it could cause users to lose their carefully configured settings, including ownership and sorting. The cost of restoring these settings would be borne by the user.

The creation entry is only displayed when a valid, permitted creation is possible and the current task is suitable for creation. If the collection is empty but the user only has read permissions, the page should clearly indicate the current visible scope, and it is unnecessary to display a primary button that rejects the action only after a click. Improving the available actions on the client side enhances usability without replacing server-side authorization. If permissions change before the user clicks, the interface must still reject the action.

The request to access also relies on a real workflow. If there is no approval channel within the space, a “Request” button that only opens a blank email cannot be displayed. While providing a link back to an accessible space or a supported help portal is possible, it should not be done solely to fulfill the promise of a layout that doesn’t actually exist. The status should be refreshed based on an authoritative response after the action is successful, rather than simply hiding the empty placeholder.

Do not announce that data has been lost if the request is still in progress.

The user first searches for “publish” and then searches for “migrate”. The second request initially returns two documents, while the first request subsequently returns an empty set. If the page is updated only based on the order of arrival, the current keyword remains “migrate”, but the content changes to “no results found”. The problem arises from the disconnect between the response identity and the current intent, rather than from the styling of an empty state component.

It’s possible to assign a request identity for each query and verify that it remains within the current scope before the response is submitted. Canceling old requests can save work, but it cannot be used as the sole guarantee of correctness. Canceling may be too late, or it may only stop the client from waiting. Space identity, filtering, and cursors together form the query scope, and it cannot be solely based on keyword comparison.

Maintaining old data while waiting for updates is a viable strategy, but it’s important to specify which range the displayed data represents. If the space has been switched, the content from the old space cannot be treated as the new space. If the same space is simply being refreshed, the old list can be retained and marked as “being updated.” When permissions are revoked, it’s also necessary to clear any cached data that is no longer allowed to be displayed, ensuring that access control takes precedence over “avoiding flickering.”

Retry with the same business scope but a new request identity. Automatic retries should have a limit and a fallback mechanism. Manual retries should provide feedback on the ongoing process to avoid repeated clicks and overlapping requests. Whether to automatically refresh after network recovery is a product strategy, and should not implicitly trigger an infinite retry each time a component is re-mounted.

Maintain Scope and Provide Truly Executable Actions

Pagination can also lead to another misleading “empty result.” A user saves a cursor, and then the data is deleted. When the user navigates to the next page, an empty set is returned. This does not prove that the entire space is empty. The product needs to define different responses for cursor invalidation, the end of the space, and no matching data. Ideally, it should also provide a way to return to the first page, rather than forcing the user to create what would be considered the first document.

There are also cases where a collection exists but the current user cannot see any objects within it. A “zero” result after permission filtering can only prove that the currently visible collection is empty, but it cannot reveal the number or names of other collections. The text could say “There are no documents within the current visible scope,” but this should align with the product’s privacy model. In some cases, it may not even be possible to determine whether a sensitive resource exists, so use a clear, general response to avoid revealing its existence.

This generalization doesn’t involve masking errors as successes. The server can intentionally use the same external response for non-existent and inaccessible resources, while still internally recording the actual classification, which facilitates diagnosis. The interface only displays publicly available information, and customer service and monitoring obtain necessary information through authorized channels. The security boundaries are determined by the protocol and cannot be inferred from different error strings viewed temporarily on the front end to identify hidden objects.

The page context also defines the disclosure scope. Whether the preceding breadcrumbs or title are retained after permissions have been revoked needs to be determined based on the sensitivity of the data. It is not necessary to mechanically require that all states retain the complete context. The goal is to retain user input and reduce redundant work, but this does not mean that previously disallowed object data should be retained.

Using Five Response Checks to Validate User Input

First, establish controlled test cases: successful empty set, successful no match, explicit rejection, delayed completion, and service failure. Verify that the title, scope, and actions for each state correspond to the input facts. Then, add test cases for late requests, invalid cursors, cache refresh failures, and revocation during read, to verify state transitions, not just static snapshots.

When testing the creation process, ensure that the actual creation fails, and the page does not claim that data already exists. Also, test the scenario where creation succeeds but the list refresh fails, to demonstrate both write and read issues. These two scenarios may occur simultaneously, and it’s crucial not to discard one to return to the normal list. When there is no match, clear the conditions one by one, ensuring that only the declared changes are reflected.

User testing does not require participants to memorize the internal enumeration. Instead, they should explain why there is no content currently, what the current range is, and what preparations are needed, and then compare this with the actual response. If the actual situation is a loading failure, they should still determine that all documents have been deleted and that the empty state information is not complete, even though the main button positions are very clear.

The assistive technology checks also need to cover changes. Feedback on loading and completion should be appropriately detected, but should not be treated as a disruptive notification with each poll; after error recovery, the focus should remain in a reasonable location. Illustrations cannot replace text, and animations should not be the sole means of determining loading status. Keyboard users should be able to operate clear and retry, and should not lose their current input due to status updates.

Why might results still be empty after creation?

The user created a document named “Publish Plan” within the “Recent Day, Keyword Migration” filter. The creation was successful, but the new object did not match the specified keywords, and the current query remains empty. It is not appropriate to claim that the creation failed or to silently remove the filter to make the object appear. The correct approach is to confirm that the creation was successful, provide access to the object, and explain that the current criteria do not include it.

This scenario requires modeling both feedback and list state separately. The object identity returned by the interface is used to indicate completed actions; the list response indicates the currently visible set. A tentative placeholder row can improve feedback, but it must be clearly marked as pending confirmation, and a clear recovery path must be available in case of failure. It is not possible to treat a temporary addition to the local array as a successful persistence, nor can a placeholder row be used to bypass the query range.

If the database reads with a delay and immediately refreshes after receiving a write confirmation, it may temporarily not show the new object. The interface needs to handle actual consistency protocols, such as using the write result to provide object access, and then waiting for controlled refresh. If there is no version or read guarantee, do not claim that a single refresh will always show the object. If the product requires immediate visibility, the backend should provide the corresponding functionality, rather than the frontend endlessly polling to mask uncertainty.

Error handling should not undo already confirmed writes. A successful creation followed by a read failure indicates that the object exists but the list update is incomplete. It should be possible to open the known object or retry the read. Recreating an object with the same name would have a different business effect. The button must clearly indicate whether it is refreshing the list or creating the object again, and should not use vague terms like “try again” to confuse the user.

Deleting the last document also involves a transitional state. When deleting, the document can be temporarily removed from the list while awaiting confirmation, but the necessary information for failed recovery must be retained; only after confirmation does it transition to a truly empty set. If other users add new documents simultaneously, the empty state only represents the current read point, and does not guarantee that the space will remain empty permanently. The next update should re-evaluate within the same range, and should not treat the initial empty state as an immutable business marker.

Consolidating Empty State Components into Fact Interfaces

The same directory can be accessed via desktop, mobile, and a shared link. The meaning of the status should be consistent across all these access points, and the layout of actions can be different. During the review, we should first verify that all three access points use the same range and permission agreement, and then discuss the specific limitations of each. Otherwise, if the desktop says there is no match, but the mobile says it’s a first-time empty set, users will receive conflicting explanations across different devices.

The component interface should accept specific reasons, authorized scope descriptions, and permitted actions, rather than a generic, optional title. If a reason is missing, a development error should be exposed, and the system should not silently generate “No data available.” The product should have a consistent layout and tone, but should not eliminate genuine differences in status.

The performance metrics are also recorded based on their status. Real empty queries, permission denials, and service failures should not be combined into a “zero-page access rate,” as this could lead operations to misinterpret infrastructure issues as users not finding content. Only record the relevant categories and necessary context, and do not automatically upload user search queries or restricted object names. The analysis of the required information should be subject to an independent privacy assessment.

Finally, a state transition check contract is used: “Current filter is empty, user removes date, loading, response returns two documents.” Each step can explain the current state, and only the date condition is modified. This closed-loop demonstrates that the empty state is not a fill-in-the-blanks image, but a reliable interface between reading, permissions, queries, and user actions.

To correctly determine an empty set, you also need to implement the pagination protocol.

Assume the current page displays the second page, and the user deletes the last record on this page. The next read will return zero records. This can only indicate that the current page has no objects; it cannot indicate that the first page is also empty. The system could return to the previous available page according to the protocol, or provide a clear action to return to the starting point. Furthermore, any automatic adjustment should ensure that the current range remains understandable, and should not silently remove filters to create a page with content.

The cursors may also become invalid due to changes in the data or protocol version upgrades. The server should distinguish between valid and invalid cursors based on the applicable contract. The client then uses this information to determine whether to end the browsing or re-query. Converting both to empty arrays would lead users to mistakenly believe that all records have been viewed. If the interface cannot distinguish between them, the page cannot provide conclusive evidence, and improvements to the protocol or clear explanations are needed.

The total count also has a range and a specific time point. If a pagination result is empty, the total count may still be 20, which could be due to a snapshot change, filtering, or a failed query. It should not be arbitrarily set to zero. When displaying the current number of returned items, the matching total count, and the visible total count, clearly indicate their meanings. The backend does not provide complete statistics, and the frontend should not use the loaded number to represent the total count.

This is a set that can be manually tracked for testing, simulating the following scenarios: deleting the last page, inserting a new record, invalidating the cursor, and a normal last page. The user should be able to determine whether to continue browsing, return to the beginning, or retry reading. The “empty state” in a pagination environment is a protocol result, not a fact that can be determined simply by looking at the array length.

Aggregating data from multiple sources does not mean that partial failures can be considered as “no data”.

Assume the homepage simultaneously reads project data, messages, and invoices. The project data is empty, message reading fails, and invoice access is denied. A general “No content” message would hide all three facts. Each area can independently display its status, and a global summary can express the necessary impact. The entire page should not be blocked simply because one secondary area fails, and it should not pretend that the failed area has already been queried.

If the task requires combining data from multiple sources, such as linking orders with payment status, it should not default to “unpaid” if the payment response is missing. Instead, the order should be retained and the field should be marked as “pending confirmation,” or, if required by business rules, operations that depend on complete results should be temporarily unavailable. The absence of a value should not be treated as the default; instead, local blanks should correspond to local facts, and zero or negative values should not be filled in arbitrarily for visual consistency.

The total count also ensures completeness. If the sum of loaded sources is zero, it does not necessarily mean that all sources have no content; it could indicate that a source has timed out and the summary hasn’t fully retrieved the data. Only partial statistics are displayed when it is permissible by the business and the scope is clear, to prevent users from interpreting them as final results. The “complete” status is derived from the actual status of each source, rather than waiting for a timer to expire before consolidating everything as “ready.”

The test records the request identity, scope, and results from each source. Ensure that messages from the old organization are delayed and do not appear on the new organization’s homepage. Verify that the “Project Successfully” button fails when the project is empty, and that the creation button only applies to projects. Modular UI does not automatically guarantee a modular state; data and action ownership require actual modeling.

Using Two Identities to Detect Leaked Hidden Resources

Assume that member A can access a private space, and member B should not be aware of its existence. The test first prepares an existing but invisible address for B, and then prepares a non-existent address. Although both display the same message “Currently cannot open,” if the former displays “Request access” and the latter displays “Create space,” B can still infer its existence based on the button. Therefore, the acceptance criteria include not only the title, but also the action set, destination links, and subsequent submission feedback.

Provide each user with two complete paths: opening the address, using the allowed return actions within the page, and re-accessing, and checking if the help link contains a hidden space name. The general help can be associated with a diagnostic number that does not contain sensitive information; whether support staff can view the internal reason is determined by their authorization. No one holding a number should be able to obtain the space title, and the number should not be used as a backup address to bypass access control.

“Check if the created path is also disclosed.” When “Creating a space with the same name” fails, it returns “The private space already exists,” which could invalidate the initial page’s hidden promise. The product can use a creation entry unrelated to resources and handle conflicts based on a naming model, but it cannot temporarily decide on the conflict text within an empty component. Whether the name can be unique and whether access can be requested should first be consistent with the privacy policy, and then determine the test expectations.

Finally, use “A” to verify normal opening and permitted sharing, and then use “B” to check for unauthorized sharing addresses. Record the identity, resource requirements, and permitted actions for each user, rather than requiring all users to see the same page. This test can only detect disclosures in visible content and interactions; response times, caching differences, and other side channels still require independent security assessments. You cannot declare that hidden resources are secure simply because two screenshots are identical.

It is not possible to preemptively create content for users when the system is in an empty state for the first time.

The new space is genuinely empty and should provide either a creation entry or selectable examples. However, the content of the examples should be clearly labeled with their source, and users should explicitly choose them before adding them. It should not automatically create projects that appear to belong to the user solely to populate the homepage. If the examples include planned tasks or external goals, they should be treated as having no real consequences by default, to avoid the empty state leading to unintended execution.

Even if users skip the example, the path should still be understandable. The introduction should provide the minimum necessary information, without overwhelming the page with promotional content. The initial task should be to create a meaningful object, rather than completing a funnel diagram. Once the object is created successfully, provide the next steps based on its identity, even if the current filter doesn’t show it, maintain accurate feedback.

The final usability test allows users to interpret page content and choose actions without explicit instructions. The system records error judgments, not just button click rates. If users interpret a failed read as a new space or a limited set as a space they can create, the system should first establish a status protocol and then adjust the illustrations and visual emphasis.

Initial Analysis: Preserve Categories First, Then Decide on Fields to Collect

The team can track successful empty queries, no matches, rejections, and service failures, which helps pinpoint task obstacles. It’s not necessary to collect all search keywords and private object names for this. First, define the problem and the necessary dimensions, then select the minimum amount of data. An empty page event is not a justification for collecting unlimited user context data.

After version changes, the classification remains comparable, or the adjustment in scope is clearly explained. Once errors are fixed, the rate of empty queries decreases, but this does not automatically prove that the content has increased. It may simply mean that failures are no longer incorrectly classified as empty. The analysis conclusions return to the factual response and the observation of the task, avoiding the further amplification of state models into product judgments.

References