Improving Onboarding Flow with Enhanced Text Matching and UI Updates
This post discusses improvements made to the onboarding process in the brenia project, focusing on more accurate text matching and design system alignment.
Enhanced Text Matching for Uncertainty Detection
Previously, the system used substring matching to detect uncertainty in user input. This led to false positives, where common substrings like "ns" (part of a longer word) were incorrectly flagged as indicators of uncertainty. To address this, the matching logic has been updated to perform exact matches for specific short tokens such as "ns", "paso", and "?". This ensures that only complete, standalone tokens are recognized, significantly reducing false positives and improving the accuracy of uncertainty detection during onboarding.
function detectUncertainty(string $input): bool {
$uncertaintyTokens = ['ns', 'paso', '?'];
$input = strtolower($input);
foreach ($uncertaintyTokens as $token) {
if ($input === $token) { // Exact match comparison
return true;
}
}
return false;
}
This PHP example illustrates the core change: using strict equality (===) to compare the input with each token, ensuring that only exact matches are considered.
UI Updates: Standardizing the Send Button
To better align with the project's design system, the custom-styled "send" button on the onboarding screen has been replaced with a standardized button component (nb-btn-primary). This component provides a consistent look and feel across the application, using a blue-to-teal gradient, rounded corners (10px border-radius), and a subtle glow effect. By adopting the nb-btn-primary class, the need for custom CSS specific to the onboarding send button (.onboarding-send-btn) has been eliminated, simplifying the codebase and promoting maintainability.
Key Takeaway
By refining text matching algorithms and adhering to the established design system, the onboarding experience in the brenia project has become more robust and visually consistent. Implementing exact matching for specific keywords significantly reduces errors, and utilizing standardized UI components ensures a cohesive user experience.