Skip to content

fix(ui): Fix hook state, status styling and destructive confirms - #300

Merged
yahyafakhroji merged 5 commits into
mainfrom
fix/hook-state-styling-and-cleanup
Nov 12, 2026
Merged

yahyafakhroji merged 5 commits into
mainfrom
fix/hook-state-styling-and-cleanup

Conversation

@yahyafakhroji

Copy link
Copy Markdown
Contributor

Problem
CodeEditor and Map ignored a system theme, the DataTable pageSize prop synced in only one of four entry points, Autosearch's debounce called a stale onSearch, and the form helpers marked optional fields with .transform() as required. RichTextEditor threw when React re-ran its effects after the editor was destroyed, which crashes the notes editor in cloud-portal. Warning and info toasts reused the error and success colours with no icon, FormCopyBox faded its value to 3.26:1 contrast, destructive MoreActions items ran on the first click, and native Button sizes fell under the 44pt touch target.

Solution
Each of the five commits fixes one area and carries tests and changesets. Warning and info toasts take muted colours from existing palette tokens, every status toast shows a labelled icon, and plain toast() looks the same as before. ActionItem gains an optional confirm step built on Dialog, which MoreActions, DataTable row actions and GroupedTable row actions all honour. Native Button gets a default hitSlop that reaches 44pt without changing its size. The cleanup commit deletes legacy DataTable context, internal shims and a committed build artefact without removing any public export, and deprecates DataTableContextValue.

Consumers will see three behaviour changes. A changed server-side limit prop now resets the table to page 1 and refetches. Fields wrapped in .catch(), .readonly() or z.preprocess() start from an empty value instead of undefined. When a confirmed action's onClick rejects, the dialog stays open and swallows the error, so the action should report its own failure.

Closes #299
Closes #297
Closes #298

CodeEditor and Map read the raw theme setting, so a system theme on a
dark OS got the light editor. Four DataTable entry points each copied
the store setup and only one synced a changed pageSize, and Autosearch's
debounce called the onSearch from an earlier render. Editor and map now
follow the provider's resolved theme, one shared hook builds and syncs
the DataTable store, and Autosearch reads its callbacks through a ref.
Three helpers unwrapped Zod schemas with different wrapper sets, and required detection looked only at the outer type, so an optional field with .transform() was reported required and constraints behind a pipe were lost. One unwrapSchema helper now walks optional, nullable, default, catch, readonly and pipe wrappers by def.type, and all three use it. Constraint extraction no longer relies on instanceof against the zod peer and also reads string min and max length.
The disabled, content and placeholder effects only checked the editor for null, so they called setEditable, getHTML and view.dispatch on a destroyed Tiptap instance and threw when StrictMode re-ran effects. Each effect and the onUpdate handler now return early when editor.isDestroyed is set.
Finished refactors left a legacy DataTable context, internal shims and
barrels, a committed v0.2 build artefact under test/, and comments that
point at another repo or at tickets nobody can open. Typography and the
assistant copy action also wrote to the clipboard by hand, threw on
insecure origins and gave no feedback. Delete what nothing imports,
deprecate the public DataTableContextValue type, and route both copy
actions through useCopyToClipboard.
Warning and info toasts reused the error and success colours, so status
was colour only, and FormCopyBox faded its value to 3.26:1 contrast.
Destructive MoreActions items ran on the first click, and native Button
sizes fell under the 44pt touch target. Toasts now use muted palette
tokens with a labelled status icon while message keeps its look, and
FormCopyBox uses theme tokens that pass 4.5:1. MoreActions items take an
optional confirm step built on Dialog, and native Button gets a default
hitSlop that reaches 44pt without changing its size and keeps its
disabled state announced.
@yahyafakhroji yahyafakhroji added the bug Something isn't working label Nov 12, 2026
@yahyafakhroji
yahyafakhroji merged commit 264fa17 into main Nov 12, 2026
10 checks passed
@yahyafakhroji
yahyafakhroji deleted the fix/hook-state-styling-and-cleanup branch November 12, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

2 participants