Skip to content

Reset selected widget when exiting record page layout edit mode#18603

Merged
Devessier merged 2 commits intomainfrom
copilot/start-implementation-widget-reset
Mar 12, 2026
Merged

Reset selected widget when exiting record page layout edit mode#18603
Devessier merged 2 commits intomainfrom
copilot/start-implementation-widget-reset

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

Before

CleanShot.2026-03-12.at.18.27.29.mp4

After

CleanShot.2026-03-12.at.18.26.37.mp4

Co-authored-by: Devessier <29370468+Devessier@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement widget reset on exiting edit mode Reset selected widget when exiting record page layout edit mode Mar 12, 2026
Copilot AI requested a review from Devessier March 12, 2026 17:24
@Devessier Devessier marked this pull request as ready for review March 12, 2026 17:28
Copilot AI review requested due to automatic review settings March 12, 2026 17:28
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Copy Markdown
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
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 ensures that when a user exits record page layout edit mode, the currently “selected/edited” widget is cleared so the UI doesn’t keep showing a widget as selected outside of edit mode.

Changes:

  • Reset pageLayoutEditingWidgetId to null when toggling page layout edit mode off.
  • Wire the widget-editing state into the existing useSetIsPageLayoutInEditMode hook to centralize the cleanup.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +71 to +72
} else {
store.set(pageLayoutEditingWidgetIdState, null);
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This new behavior (clearing pageLayoutEditingWidgetId when leaving edit mode) isn’t covered by an automated test. Given the existing hook test suite under page-layout/hooks/__tests__, please add a regression test that sets a non-null pageLayoutEditingWidgetId, calls setIsPageLayoutInEditMode(false), and asserts the widget id is reset to null (and ideally that it doesn’t change when toggling true).

Copilot uses AI. Check for mistakes.
@Devessier Devessier added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit a3c392c Mar 12, 2026
91 of 93 checks passed
@Devessier Devessier deleted the copilot/start-implementation-widget-reset branch March 12, 2026 18:05
@twenty-eng-sync
Copy link
Copy Markdown

Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

1 similar comment
@twenty-eng-sync
Copy link
Copy Markdown

Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫

node failed.

Log

Details
�[31mError: �[39m RequestError [HttpError]: Validation Failed: {"message":"The listed users cannot be searched either because the users do not exist or you do not have permission to view the users.","resource":"Search","field":"q","code":"invalid"} - https://docs.github.com/v3/search/
    at /home/runner/work/twenty/twenty/node_modules/�[4m@octokit/request�[24m/dist-node/index.js:125:21
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)�[39m {
  status: �[33m422�[39m,
  response: {
    url: �[32m'https://api.github.com/search/issues?q=is%3Apr%20author%3ACopilot%20is%3Aclosed%20repo%3Atwentyhq%2Ftwenty&per_page=2&page=1'�[39m,
    status: �[33m422�[39m,
    headers: {
      �[32m'access-control-allow-origin'�[39m: �[32m'*'�[39m,
      �[32m'access-control-expose-headers'�[39m: �[32m'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'�[39m,
      �[32m'cache-control'�[39m: �[32m'no-cache'�[39m,
      �[32m'content-length'�[39m: �[32m'300'�[39m,
      �[32m'content-security-policy'�[39m: �[32m"default-src 'none'"�[39m,
      �[32m'content-type'�[39m: �[32m'application/json; charset=utf-8'�[39m,
      date: �[32m'Thu, 12 Mar 2026 18:07:23 GMT'�[39m,
      �[32m'referrer-policy'�[39m: �[32m'origin-when-cross-origin, strict-origin-when-cross-origin'�[39m,
      server: �[32m'github.com'�[39m,
      �[32m'strict-transport-security'�[39m: �[32m'max-age=31536000; includeSubdomains; preload'�[39m,
      vary: �[32m'Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With'�[39m,
      �[32m'x-accepted-github-permissions'�[39m: �[32m'allows_permissionless_access=true'�[39m,
      �[32m'x-content-type-options'�[39m: �[32m'nosniff'�[39m,
      �[32m'x-frame-options'�[39m: �[32m'deny'�[39m,
      �[32m'x-github-api-version-selected'�[39m: �[32m'2022-11-28'�[39m,
      �[32m'x-github-media-type'�[39m: �[32m'github.v3; format=json'�[39m,
      �[32m'x-github-request-id'�[39m: �[32m'6C01:12CB46:5607C98:574CB1A:69B300DB'�[39m,
      �[32m'x-ratelimit-limit'�[39m: �[32m'30'�[39m,
      �[32m'x-ratelimit-remaining'�[39m: �[32m'30'�[39m,
      �[32m'x-ratelimit-reset'�[39m: �[32m'1773338903'�[39m,
      �[32m'x-ratelimit-resource'�[39m: �[32m'search'�[39m,
      �[32m'x-ratelimit-used'�[39m: �[32m'1'�[39m,
      �[32m'x-xss-protection'�[39m: �[32m'0'�[39m
    },
    data: {
      message: �[32m'Validation Failed'�[39m,
      errors: �[36m[Array]�[39m,
      documentation_url: �[32m'https://docs.github.com/v3/search/'�[39m,
      status: �[32m'422'�[39m
    }
  },
  request: {
    method: �[32m'GET'�[39m,
    url: �[32m'https://api.github.com/search/issues?q=is%3Apr%20author%3ACopilot%20is%3Aclosed%20repo%3Atwentyhq%2Ftwenty&per_page=2&page=1'�[39m,
    headers: {
      accept: �[32m'application/vnd.github.v3+json'�[39m,
      �[32m'user-agent'�[39m: �[32m'octokit-rest.js/20.1.2 octokit-core.js/5.2.2 Node.js/24'�[39m,
      authorization: �[32m'token [REDACTED]'�[39m
    },
    request: { hook: �[36m[Function: bound bound register]�[39m }
  }
}
danger-results://tmp/danger-results-4a718e83.json

Generated by 🚫 dangerJS against 04c3f5b

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants