Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(compass-editor): refactor JSON editor actions container into its own component #6441

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

kraenhansen
Copy link
Contributor

Description

As a preparation for COMPASS-4635 this refactors the JSON editor, extracting the actions container into its own component. This refactor brings no additional features or visual changes.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@kraenhansen kraenhansen added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Nov 4, 2024
@kraenhansen kraenhansen self-assigned this Nov 4, 2024
@kraenhansen kraenhansen force-pushed the kh/refactor-editor-actions branch from 224314b to 306b116 Compare November 4, 2024 13:32
@@ -14,3 +14,16 @@ export type CompletionWithServerInfo = {
/** Optional completion description */
description?: string;
};

export type EditorRef = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this here to be able to reference it from both editor.tsx and actions-container.tsx without introducing a circular import dependency.

@@ -1537,7 +1468,7 @@ const MultilineEditor = React.forwardRef<EditorRef, MultilineEditorProps>(
className={cx(
multilineEditorContainerStyle,
darkMode && multilineEditorContainerDarkModeStyle,
!!actions.length && multilineEditorContainerWithActionsStyle,
hasActions && multilineEditorContainerWithActionsStyle,
Copy link
Contributor Author

@kraenhansen kraenhansen Nov 4, 2024

Choose a reason for hiding this comment

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

The actions.length was actually always > 0, since we didn't trim the array from false values that could arise from the copyable or formattable being false.

@kraenhansen kraenhansen force-pushed the kh/refactor-editor-actions branch 2 times, most recently from 216642b to 409137a Compare November 4, 2024 13:43
@kraenhansen kraenhansen force-pushed the kh/refactor-editor-actions branch from 409137a to fe4442e Compare November 4, 2024 13:50
Anemy
Anemy approved these changes Nov 4, 2024
@kraenhansen kraenhansen merged commit d7d58d5 into main Nov 5, 2024
30 checks passed
@kraenhansen kraenhansen deleted the kh/refactor-editor-actions branch November 5, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants