From 42e47cf558d2b4fb7a74f73bb08599c5e148d388 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Mon, 18 May 2026 15:37:17 -0500 Subject: [PATCH] fix: removed bio limit --- .changeset/fix-remove-bio-limit.md | 5 ++++ .../features/settings/account/BioEditor.tsx | 27 +++---------------- 2 files changed, 8 insertions(+), 24 deletions(-) create mode 100644 .changeset/fix-remove-bio-limit.md diff --git a/.changeset/fix-remove-bio-limit.md b/.changeset/fix-remove-bio-limit.md new file mode 100644 index 000000000..de8f75f6c --- /dev/null +++ b/.changeset/fix-remove-bio-limit.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Removed the arbitrary bio limit from the bio editor. diff --git a/src/app/features/settings/account/BioEditor.tsx b/src/app/features/settings/account/BioEditor.tsx index 70556fbf9..100d12a27 100644 --- a/src/app/features/settings/account/BioEditor.tsx +++ b/src/app/features/settings/account/BioEditor.tsx @@ -39,8 +39,6 @@ type BioEditorProps = { onSave: (htmlContent: string, plainText: string) => void; }; -const BIO_LIMIT = 1024; - export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditorProps) { const editor = useEditor(); const [enterForNewline] = useSetting(settingsAtom, 'enterForNewline'); @@ -48,19 +46,12 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor const [autocompleteQuery, setAutocompleteQuery] = useState>(); const [hasChanged, setHasChanged] = useState(false); - const [charCount, setCharCount] = useState(0); const prevValue = useRef(value); const initialized = useRef(false); - const updateStats = useCallback(() => { - const plainText = toPlainText(editor.children).trim(); - setCharCount(plainText.length); - }, [editor]); - const handleSave = useCallback(() => { const plainText = toPlainText(editor.children).trim(); - if (plainText.length > BIO_LIMIT) return; const customHtml = trimCustomHtml(toMatrixCustomHTML(editor.children, {})); @@ -104,9 +95,8 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor initialized.current = true; setHasChanged(false); - updateStats(); } - }, [value, editor, updateStats]); + }, [value, editor]); const handleKeyDown: KeyboardEventHandler = useCallback( (evt) => { @@ -142,11 +132,8 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor editor.insertNode(createEmoticonElement(key, shortcode)); moveCursor(editor); setHasChanged(true); - updateStats(); }; - const isOverLimit = charCount > BIO_LIMIT; - return ( @@ -164,7 +151,6 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor placeholder="Write a bio..." onChange={() => { if (!hasChanged) setHasChanged(true); - updateStats(); }} onKeyDown={handleKeyDown} onKeyUp={handleKeyUp} @@ -183,9 +169,9 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor {hasChanged && ( : undefined @@ -194,13 +180,6 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor {isSaving ? 'Saving' : 'Save'} )} - - {charCount} / {BIO_LIMIT} -