Skip to content

feat(dropdown): Add toggle button and remove force open in editor option (WW-3773)#12

Open
leo91000 wants to merge 3 commits intomainfrom
feature/WW-3773-add-toggle-button
Open

feat(dropdown): Add toggle button and remove force open in editor option (WW-3773)#12
leo91000 wants to merge 3 commits intomainfrom
feature/WW-3773-add-toggle-button

Conversation

@leo91000
Copy link
Contributor

@leo91000 leo91000 commented May 20, 2025

Summary

  • Added a toggle button in the editor panel to enable toggling the dropdown's state during editing
  • Removed the 'Force display in editor' option as it's no longer needed with the toggle button
  • Made the required code changes to support the new toggle functionality

@leo91000 leo91000 force-pushed the feature/WW-3773-add-toggle-button branch from 1cc20bd to e569f75 Compare May 20, 2025 18:16
@leo91000 leo91000 changed the base branch from main to WW-3574-ai-md May 20, 2025 18:17
@leo91000 leo91000 force-pushed the feature/WW-3773-add-toggle-button branch from e569f75 to 4f6c84f Compare May 21, 2025 11:26
@leo91000 leo91000 requested a review from Copilot May 21, 2025 11:57
Copy link

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 introduces a toggle button to control the dropdown state directly in the editor while removing the former “force display in editor” option. Key changes include the addition of new actions in the configuration file, modifications to the dropdown properties, and updates to the component logic in wwElement.vue to support the toggle functionality.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ww-config.js Added new actions and properties for toggling dropdown state and force open behavior; however, there is a potential mismatch in action assignment.
src/wwElement.vue Updated the component to include toggling functions for dropdown and force open states, but toggle functions are implemented as computed properties.

Comment on lines +21 to +23
text: { en: 'Toggle' },
action: 'toggleForceOpenInEditor',
},
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

The 'toggleDropdown' property options incorrectly set the action to 'toggleForceOpenInEditor'; if the intended behavior is to toggle the dropdown state, update the action to 'toggleDropdown'.

Suggested change
text: { en: 'Toggle' },
action: 'toggleForceOpenInEditor',
},
text: { en: 'Toggle' },
action: 'toggleDropdown',
},

Copilot uses AI. Check for mistakes.
Comment on lines 43 to 47
computed: {
toggleForceOpenInEditor() {
this.forceOpenInEditor = !this.forceOpenInEditor;
},
isEditing() {
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Using computed properties to perform state mutations is not recommended; converting toggleForceOpenInEditor (and toggleDropdown) to methods would better align with Vue best practices.

Suggested change
computed: {
toggleForceOpenInEditor() {
this.forceOpenInEditor = !this.forceOpenInEditor;
},
isEditing() {
computed: {
isEditing() {
/* wwEditor:start */
return this.wwEditorState.editMode === wwLib.wwEditorHelper.EDIT_MODES.EDITION;
/* wwEditor:end */

Copilot uses AI. Check for mistakes.
},
computed: {
toggleForceOpenInEditor() {
this.forceOpenInEditor = !this.forceOpenInEditor;
Copy link
Member

Choose a reason for hiding this comment

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

je suis d'accord avec copilot ;)

Copy link
Member

Choose a reason for hiding this comment

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

en vrai ça doit juste bouger dans methods, si j'en crois la config

Copy link
Contributor Author

@leo91000 leo91000 May 23, 2025

Choose a reason for hiding this comment

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

La computed au lieu de la methods c'était clairement un soucis.

Par contre je suis pas sure pour l'autre. Si on toggle dans l'éditeur, en cliquant quelque part ca risque de fermer le dropdown non ? C'est pas ce qu'on veut ?

Base automatically changed from WW-3574-ai-md to main May 22, 2025 07:13
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.

4 participants