Copilot commented on code in PR #17731:
URL: 
https://github.com/apache/dolphinscheduler/pull/17731#discussion_r2562636620


##########
dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx:
##########
@@ -96,6 +96,7 @@ export default defineComponent({
               <NFormItem path='content'>
                 <MonacoEditor
                   v-model={[this.resourceViewRef.state.value.content, 'value']}
+                  height='calc(100vh - 320px)'

Review Comment:
   The hard-coded magic number '320px' lacks context. Consider extracting it as 
a named constant (e.g., `EDITOR_VERTICAL_OFFSET_EDIT = 320`) to document what 
this offset represents (header, form items, buttons, etc.) and make future 
adjustments easier.



##########
dolphinscheduler-ui/src/components/monaco-editor/index.tsx:
##########
@@ -164,7 +168,7 @@ export default defineComponent({
       <div
         ref='editorRef'
         style={{
-          height: '300px',
+          height: this.height,

Review Comment:
   The dynamic height uses viewport-based calculations without a minimum height 
constraint. On small screens or when the offset is large, this could result in 
unusable editor heights. Consider adding a `min-height` style (e.g., 
`minHeight: '200px'`) to ensure the editor remains functional on all screen 
sizes.
   ```suggestion
             height: this.height,
             minHeight: '200px',
   ```



##########
dolphinscheduler-ui/src/views/resource/components/resource/create/index.tsx:
##########
@@ -95,7 +95,10 @@ export default defineComponent({
                 width: '90%'
               }}
             >
-              <MonacoEditor v-model={[this.fileForm.content, 'value']} />
+              <MonacoEditor 
+                v-model={[this.fileForm.content, 'value']} 
+                height='calc(100vh - 420px)'

Review Comment:
   The hard-coded magic number '420px' lacks context. Consider extracting it as 
a named constant (e.g., `EDITOR_VERTICAL_OFFSET_CREATE = 420`) to document what 
this offset represents and why it differs from the edit page offset (320px).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to