From 93c4719a2140070b33f69dd0f12b4de2619a25a6 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 8 Aug 2025 01:01:01 +0300 Subject: Check handle as you type (#8601) * check handle as you type * metrics * add metric types * fix overflow * only check reserved handles for bsky.social, fix test * change validation check name * tweak input * move ghosttext component to textfield * tweak styles to try and match latest * add suggestions * improvements, metrics * share logic between typeahead and next button * Apply suggestions from code review Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * update checks, disable button if unavailable * convert to lowercase * fix bug with checkHandleAvailability * add gate * move files around to make clearer * fix bad import * Fix flashing next button * Enable for TF --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> Co-authored-by: Hailey Co-authored-by: Eric Bailey --- __tests__/lib/strings/handles.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '__tests__') diff --git a/__tests__/lib/strings/handles.test.ts b/__tests__/lib/strings/handles.test.ts index 4456fae94..f3b289afd 100644 --- a/__tests__/lib/strings/handles.test.ts +++ b/__tests__/lib/strings/handles.test.ts @@ -1,4 +1,4 @@ -import {IsValidHandle, validateServiceHandle} from '#/lib/strings/handles' +import {type IsValidHandle, validateServiceHandle} from '#/lib/strings/handles' describe('handle validation', () => { const valid = [ @@ -18,17 +18,17 @@ describe('handle validation', () => { }) const invalid = [ - ['al', 'bsky.social', 'frontLength'], + ['al', 'bsky.social', 'frontLengthNotTooShort'], ['-alice', 'bsky.social', 'hyphenStartOrEnd'], ['alice-', 'bsky.social', 'hyphenStartOrEnd'], ['%%%', 'bsky.social', 'handleChars'], - ['1234567890123456789', 'bsky.social', 'frontLength'], + ['1234567890123456789', 'bsky.social', 'frontLengthNotTooLong'], [ '1234567890123456789', 'my-custom-pds-with-long-name.social', - 'frontLength', + 'frontLengthNotTooLong', ], - ['al', 'my-custom-pds-with-long-name.social', 'frontLength'], + ['al', 'my-custom-pds-with-long-name.social', 'frontLengthNotTooShort'], ['a'.repeat(300), 'toolong.com', 'totalLength'], ] satisfies [string, string, keyof IsValidHandle][] it.each(invalid)( -- cgit 1.4.1