Home Projects Portfolio Dashboard Export PDF Log in

Enhancing Admin Decision UX: Persistent States and Dynamic Feedback in Justifai

The justifai project involves critical document processing, where administrators rely on a dashboard to efficiently review and validate documents. Previously, the user experience for making these decisions had a small but significant flaw: validated document cards would disappear almost immediately after an action, making the visual confirmation of a decision fleeting and difficult to audit.

The Problem: Ephemeral Feedback

When an administrator made a decision, such as validating a document, the corresponding card would vanish from the dashboard within a mere 1.1 seconds. While a validation stamp briefly appeared, the rapid disappearance meant users had little time to confirm the decision visually or take a screenshot for record-keeping. This created a less satisfying and at times confusing user experience, requiring admins to rely on memory or secondary checks to confirm actions.

The Solution: Persistent Decision States

To significantly improve this, we implemented a new user experience flow. Now, when an admin makes a decision on a document card, the card no longer disappears instantly. Instead, it remains visible on the dashboard, clearly displaying the validation stamp and a new, dynamic status badge (e.g., "Validé" for validated, "Rejeté" for rejected, or "À revoir" for documents needing further review). Crucially, all action buttons on that card are hidden, signaling that a decision has been finalized. The card is only removed when the admin explicitly refreshes the page, providing ample time for visual confirmation, reflection, and auditing.

Implementing Visual Feedback in React

In a React application, managing the state of such dynamic components is fundamental. When an admin performs an action (e.g., clicks "Validate"), the component's internal state (or a global state, depending on the architecture) is updated to reflect that a decisionMade event has occurred and to set the documentStatus accordingly. This state change then triggers a re-render, conditionally displaying the status badge and hiding the action buttons.

function DocumentCard({ documentData, onDecisionMade }) {
  const [isDecisionFinalized, setIsDecisionFinalized] = React.useState(false);
  const [currentStatus, setCurrentStatus] = React.useState(documentData.status);

  const handleAction = (decision) => {
    // Simulate API call to update document status
    console.log(`Updating document ${documentData.id} to ${decision}`);
    setIsDecisionFinalized(true);
    setCurrentStatus(decision);
    onDecisionMade(documentData.id, decision); // Notify parent component if needed
  };

  return (
    <div className="document-card">
      {/* Document details go here */}
      {isDecisionFinalized && (
        <span className={`status-badge status-${currentStatus.toLowerCase()}`}>
          {currentStatus}
        </span>
      )}
      {!isDecisionFinalized && (
        <div className="action-buttons">
          <button onClick={() => handleAction('Validé')}>Validate</button>
          <button onClick={() => handleAction('Rejeté')}>Reject</button>
        </div>
      )}
    </div>
  );
}

This React component snippet demonstrates how local state (isDecisionFinalized, currentStatus) controls the rendering of the status badge and action buttons based on the admin's interaction.

Styling Dynamic Status Badges with CSS

The visual distinction of the status badges is achieved through specific CSS styling. Each status type—Validated, Rejected, To Review—receives a distinct background color and text styling, providing immediate visual cues to the administrator.

.status-badge {
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: 600;
  color: #ffffff;
  margin-left: 10px;
  display: inline-block;
}

.status-validé {
  background-color: #28a745; /* Green for success */
}

.status-rejeté {
  background-color: #dc3545; /* Red for rejection */
}

.status-à-revoir {
  background-color: #ffc107; /* Yellow for warning/review */
  color: #333333; /* Darker text for contrast on yellow */
}

These CSS rules ensure that each badge instantly conveys the document's status, making the admin dashboard more intuitive and user-friendly.

Conclusion: Enhancing Usability through Thoughtful Persistence

By transitioning from ephemeral feedback to a persistent decision state with clear visual indicators, we've significantly enhanced the administrative user experience within justifai. This change not only makes the document validation process more intuitive and less prone to user error but also supports better auditing and confirmation workflows. When designing user interfaces, consider where temporary actions can benefit from persistent visual feedback, as this often leads to greater clarity, reduced user frustration, and an overall more robust application.


Generated with Gitvlg.com

Enhancing Admin Decision UX: Persistent States and Dynamic Feedback in Justifai
Seydina Limamou Laye Yade

Seydina Limamou Laye Yade

Author

Share: