Skip to content

Mobile: display the save form button on Board Settings page as a bridge button#2637

Merged
jorgemanrubia merged 1 commit intomainfrom
mobile/board-settings
Mar 3, 2026
Merged

Mobile: display the save form button on Board Settings page as a bridge button#2637
jorgemanrubia merged 1 commit intomainfrom
mobile/board-settings

Conversation

@jayohms
Copy link
Contributor

@jayohms jayohms commented Feb 28, 2026

This moves the "Save changes" button placement to the top right, since it can otherwise be difficult to find when there's a long list of people on the board.

Copilot AI review requested due to automatic review settings February 28, 2026 10:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Board Settings edit form to integrate with the Hotwire Native bridge form component so the “Save changes” action can be surfaced as a native (top-right) bridge button on mobile.

Changes:

  • Adds the bridge--form Stimulus controller to the Board Settings form.
  • Marks the existing “Save changes” submit button as the bridge--form submit target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

controller: "form boards-form",
controller: "form boards-form bridge--form",
boards_form_self_removal_prompt_message_value: "Are you sure you want to remove yourself from this board? You won’t be able to get back in unless someone invites you.",
action: "turbo:submit-start->boards-form#submitWithWarning" } do |form| %>
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

bridge--form is added as a controller, but the form’s data-action does not include the Turbo submit hooks (turbo:submit-start->bridge--form#submitStart / turbo:submit-end->bridge--form#submitEnd). As a result, the Hotwire Native bridge won’t receive submit lifecycle events. Consider switching this to bridged_form_with (see FormsHelper#bridged_form_with) or appending those actions alongside the existing boards-form#submitWithWarning action.

Suggested change
action: "turbo:submit-start->boards-form#submitWithWarning" } do |form| %>
action: "turbo:submit-start->boards-form#submitWithWarning turbo:submit-start->bridge--form#submitStart turbo:submit-end->bridge--form#submitEnd" } do |form| %>

Copilot uses AI. Check for mistakes.
Comment on lines +25 to 26
<button type="submit" id="log_in" class="btn btn--link center txt-normal" data-bridge--form-target="submit" <%= "disabled" unless Current.user.can_administer_board?(@board) %>>
<span>Save changes</span>
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The submit button is disabled for non-admins, but bridge/form_controller doesn’t send the initial disabled/enabled state on connect (it only observes later attribute changes). With data-bridge--form-target="submit" present, the native “Save” bridge button may appear enabled for users who can’t administer the board and then do nothing on tap. Consider only adding the bridge submit target (and/or the bridge--form controller) when Current.user.can_administer_board?(@board) is true, or update the bridge integration to communicate the initial disabled state.

Copilot uses AI. Check for mistakes.
@jorgemanrubia jorgemanrubia merged commit 7f0ac98 into main Mar 3, 2026
14 of 16 checks passed
@jorgemanrubia jorgemanrubia deleted the mobile/board-settings branch March 3, 2026 10:23
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.

3 participants