-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CodeEditor/UrlDrilldown] Add fitToContent
support, autoresize the url template editor
#175561
[CodeEditor/UrlDrilldown] Add fitToContent
support, autoresize the url template editor
#175561
Conversation
/ci |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
_editor.current?.layout(); | ||
}, []); | ||
|
||
useResizeDetector({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed to be unused. The resize detection is working where it is needed using built in automaticLayout
option. I showed it in a new story I created
@@ -181,29 +190,18 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({ | |||
|
|||
const isReadOnly = options?.readOnly ?? false; | |||
|
|||
const _editor = useRef<monaco.editor.IStandaloneCodeEditor | null>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to move editor
to setState so that I could properly register the callback that would react to props changes
@@ -1,5 +1,5 @@ | |||
.urlTemplateEditor__container { | |||
.monaco-editor .lines-content.monaco-editor-background { | |||
margin: $euiSizeS; | |||
margin: 0 $euiSizeS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the vertical margin here broke the height calculation. Moved it to padding
as part of monaco options
@@ -106,7 +106,9 @@ export const MockedMonacoEditor = ({ | |||
className?: string; | |||
['data-test-subj']?: string; | |||
}) => { | |||
editorWillMount?.(monaco); | |||
useComponentWillMount(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing willMount in the mock because now it re-renders twice due to setState(editor)
(this is fine, just the tests expectation got broken because of incomplete mock)
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, drilldowns URL editor work like a charm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Dosant this change works perfectly for the url template editor, but unfortunately has unintended side effects for ESQL query input field in discover, see;
Screen.Recording.2024-01-30.at.13.31.55.mov
it seems we might need to apply new prop fitToContent
to the text based editor
…l-editor-auto-height
…nt/kibana into d/2024-01-25-url-editor-auto-height
…l-editor-auto-height
@eokoneyo, thank you! should be fixed |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…nt/kibana into d/2024-01-25-url-editor-auto-height
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌🏾 ... thanks for covering the edge case!!
…url template editor (elastic#175561) ## Summary This PR fixes the paper cut where the URL template editor in URL drilldown is unusably small. It now can expand as you type longer URLs fix elastic#132513 The input box now expands from 5 to 15 lines.
…url template editor (elastic#175561) ## Summary This PR fixes the paper cut where the URL template editor in URL drilldown is unusably small. It now can expand as you type longer URLs fix elastic#132513 The input box now expands from 5 to 15 lines.
…url template editor (elastic#175561) ## Summary This PR fixes the paper cut where the URL template editor in URL drilldown is unusably small. It now can expand as you type longer URLs fix elastic#132513 The input box now expands from 5 to 15 lines.
Summary
This PR fixes the paper cut where the URL template editor in URL drilldown is unusably small. It now can expand as you type longer URLs
fix #132513
The input box now expands from 5 to 15 lines.
expanding.editor.mov