Skip to content

Conversation

@Ahamed1846
Copy link
Contributor

Fixes #4723

This PR fixes a UX issue in the Exploration inspector where the Save button appeared disabled while editing the exploration name or description. Although changes were being made, the Save button only became enabled after the input lost focus, which was confusing and made it seem like edits were not being detected.

Technical details

Problem

The Save button relies on a hasChanges flag to reflect unsaved edits.

Previously:

  • hasChanges was updated only on the change event
  • change fires only after the input loses focus
  • While typing, the Save button remained visually disabled

This caused a mismatch between user actions and UI feedback.

Fix

  • Updated the name and description inputs to mark the form as changed on the input event
  • Preserved existing change handlers to avoid altering save behavior

This ensures the Save button reflects unsaved changes immediately while typing.

Behavior changes

  • Save button enables as soon as the user starts typing
  • Visual state now accurately reflects pending edits
  • No changes to save logic or backend behavior

Files touched

  • mathesar_ui/src/systems/data-explorer/exploration-inspector/ExplorationTab.svelte

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@pavish pavish added the pr-status: review A PR awaiting review label Dec 19, 2025
@pavish pavish self-assigned this Dec 19, 2025
Comment on lines 113 to 128
on:change={handleNameChange}
on:input={setHasChangesToTrue}
on:input={(e) => {
setHasChangesToTrue();
handleNameChange(e);
}}
/>
</LabeledInput>
</FormField>
<FormField>
<LabeledInput label={$_('description')} layout="stacked">
<TextArea
value={description}
aria-label={$_('description')}
on:change={handleDescriptionChange}
on:input={setHasChangesToTrue}
on:input={(e) => {
setHasChangesToTrue();
handleDescriptionChange(e);
}}
Copy link
Member

Choose a reason for hiding this comment

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

The name and description update should happen after a debounced interval when the user is typing and it should immediately happen when the input loses focus. Please use the Debounce component from our component library to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the name and description inputs to use the Debounce component, with debounced updates during typing and immediate updates on blur.

@pavish pavish added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Dec 19, 2025
@pavish pavish assigned Ahamed1846 and unassigned pavish Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-status: revision A PR awaiting follow-up work from its author after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Save" button for Explorations looks disabled when exploration name or description is changed

2 participants