Skip to content

PT-3739 UX follow-on tasks#2147

Open
tombogle wants to merge 5 commits intomainfrom
pt-3739-ux-follow-on-tweaks
Open

PT-3739 UX follow-on tasks#2147
tombogle wants to merge 5 commits intomainfrom
pt-3739-ux-follow-on-tweaks

Conversation

@tombogle
Copy link
Copy Markdown
Contributor

@tombogle tombogle commented Mar 26, 2026

  • Added to Undo/Redo tool tips

This change is Reviewable


Open with Devin

@tombogle tombogle self-assigned this Mar 26, 2026
Improved aria labels in UndoRedoButtons to use the localized string
Added ButtonGroup (and conditional Separators based on variant)
…w used in Footnote Editor and Comment Editor)

Added optional canUndo and canRedo props to EditorKeyboardShortcuts component to prevent keyboard shortcuts use in cases where undo or redo might do something in the editor even though they should not (see PT-3922).
# Conflicts:
#	lib/platform-bible-react/dist/index.cjs
#	lib/platform-bible-react/dist/index.cjs.map
#	lib/platform-bible-react/dist/index.js
#	lib/platform-bible-react/dist/index.js.map
@tombogle tombogle marked this pull request as ready for review March 27, 2026 16:44
@tombogle
Copy link
Copy Markdown
Contributor Author

Introduces a trivial(?) regression in that the tooltip for the Comment editor now says "Save" instead of "Save Comment". That could be fixed if desired, but I wasn't very sure if that was intentional/necessary, so I didn't want to do additional work to "fix" it unless it is actually desirable.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines +529 to +534
<CancelAcceptButtons
onCancelClick={onClose}
onAcceptClick={closeAndSave}
canAccept={!isAtInitialState}
localizedStrings={localizedStrings}
/>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 FootnoteEditor accept button disabled when only custom caller text changes

The canAccept condition !isAtInitialState || originalCallerType !== callerType does not account for changes to the custom caller text. When a note already has a custom caller (e.g. *) and the user changes it to a different value (e.g. +), both originalCallerType and callerType remain 'custom', and isAtInitialState remains true (because the editor USJ content is unchanged). This means canAccept evaluates to false, the accept button is disabled, and the user cannot commit the change to the parent editor via closeAndSave (which is the only path that calls replaceEmbedUpdate with applyToParent=true — see footnote-editor.component.tsx:270-296). The cancel button calls onClose directly, which discards the caller change.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@tombogle
Copy link
Copy Markdown
Contributor Author

image

@tombogle
Copy link
Copy Markdown
Contributor Author

image

Removed useless canCancel and variant props from CancelAcceptButtons component
Added stories for CancelAcceptButtons component
Addressed the problem of not being able to save a footnote change if the only thing the user did was to change the caller type.
@merchako
Copy link
Copy Markdown
Contributor

lib/platform-bible-react/src/components/basics/cancel-accept-buttons.component.tsx line 66 at r3 (raw file):

          <TooltipTrigger asChild>
            <Button
              aria-label={cancelLocalized}

The copy button in lib/platform-bible-react/src/components/advanced/footnote-editor/footnote-editor.component.tsx is missing its aria-label.

Copy link
Copy Markdown
Contributor

@merchako merchako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merchako reviewed 5 files and made 1 comment.
Reviewable status: 5 of 19 files reviewed, 1 unresolved discussion (waiting on tombogle).


lib/platform-bible-react/src/components/advanced/footnote-editor/footnote-editor.component.tsx line 523 at r3 (raw file):
Can we make this a <ButtonGroup> parents of the button groups <UndoRedoButtons> and <CancelAcceptButtons>?

Each component internally uses ButtonGroup. But the two groups are not nested in a shared parent ButtonGroup — they sit in a flex div with tw-gap-4. Alex's requested CSS gap logic (has-[>[data-slot=button-group]]:tw-gap-2) won't apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants