Skip to content

[Improvement-17248][UI] Optimize file details display area to reduce blank space#17731

Merged
ruanwenjun merged 13 commits intoapache:devfrom
zhan7236:Improvement-17248
Dec 4, 2025
Merged

[Improvement-17248][UI] Optimize file details display area to reduce blank space#17731
ruanwenjun merged 13 commits intoapache:devfrom
zhan7236:Improvement-17248

Conversation

@zhan7236
Copy link
Contributor

@zhan7236 zhan7236 commented Nov 26, 2025

What is the purpose of the pull request

Fix #17248

This PR optimizes the file details display area in the Resource Center to reduce blank space and ensure buttons are always visible.

Brief change log

  • Use viewport-based height calculation (calc(100vh - Npx)) for Monaco Editor to dynamically adapt to different screen sizes
  • Remove complex flexbox layout that caused infinite scrolling issues
  • Reduce Monaco Editor minHeight from 200px to 150px for better small screen support
  • Ensure "Save" and "Return" buttons remain visible without scrolling on normal screen sizes

Verify this pull request

This pull request was tested manually by:

  1. Opening the file create page (/resource/file/create)
  2. Opening the file edit/detail page
  3. Verifying buttons are visible at the bottom without scrolling
  4. Testing with different browser window sizes to ensure responsive behavior
  5. Confirming that only on very small screens does scrolling become necessary (expected behavior)

Screenshots

12c93d5090fbb92bda2f9e289afd63b3 37263aae9d2d967a0c8879abbea0ca14

Related Issues

Closes #17248

…blank space

- Add height prop to MonacoEditor component with default value '300px'
- Use dynamic height calculation for file edit page: calc(100vh - 320px)
- Use dynamic height calculation for file create page: calc(100vh - 420px)
- Ensures MonacoEditor fills the available screen space
- Improves user viewing experience by reducing large blank space

This resolves the issue where the file details display area had
excessive blank space at the bottom.

Closes apache#17248
@github-actions github-actions bot added the UI ui and front end related label Nov 26, 2025
@SbloodyS SbloodyS requested a review from Copilot November 26, 2025 02:39
@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Nov 26, 2025
@SbloodyS SbloodyS added this to the 3.4.0 milestone Nov 26, 2025
Copy link
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 optimizes the file details display area in the resource center by making the MonacoEditor component fill available screen space dynamically. The component now accepts a configurable height prop while maintaining backward compatibility with a default value, and applies viewport-based height calculations to edit and create pages.

  • Added a height prop to MonacoEditor component with a '300px' default for backward compatibility
  • Applied dynamic viewport-based heights to file edit (calc(100vh - 320px)) and create (calc(100vh - 420px)) pages
  • Improved space utilization by eliminating excessive blank space below the editor

Reviewed changes

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

File Description
dolphinscheduler-ui/src/components/monaco-editor/index.tsx Added configurable height prop with '300px' default value
dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx Applied dynamic height calculation for edit page
dolphinscheduler-ui/src/views/resource/components/resource/create/index.tsx Applied dynamic height calculation for create page

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

zhan7236 and others added 2 commits November 26, 2025 02:57
- Extract hard-coded magic numbers (320px, 420px) to named constants
- Add minHeight constraint (200px) to MonacoEditor for better UX on small screens
- Document offset values with detailed comments explaining what UI elements contribute to each offset

Fixes apache#17248
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

OKIkGovMxXf6H2C.png

The following two buttons are beyond the current page, and need to be slid down to be fully displayed. It is best that just one screen does not need to be slid down.

BTW, Please run pnpm run lint to format the code. @zhan7236

- Replace hardcoded pixel offsets (calc(100vh - 320px)) with Flexbox layout
- Add .file-edit-content container with flex column layout
- Add .editor-wrapper with flex: 1 to auto-fill remaining space
- Add .button-area with flex-shrink: 0 to keep buttons always visible
- Remove constants.ts as fixed pixel offsets are no longer needed
- Add minHeight: 200px to ensure editor has minimum usable height

This approach is more robust than fixed pixel calculations:
- Automatically adapts to different screen sizes
- Buttons are always visible without scrolling
- No need to manually calculate header/footer heights

Fixes apache#17248
@zhan7236
Copy link
Contributor Author

Sorry, I need to make a further fix.

@SbloodyS
Copy link
Member

Sorry, I need to make a further fix.

It's ok. You can take your time.

- Add overflow: hidden to .file-edit-content container
- Add overflow: hidden to .form-content
- Add overflow: hidden and max-height to .editor-wrapper
- This ensures the editor stays within bounds and buttons remain visible
@zhan7236
Copy link
Contributor Author

I have re-fixed the code. Could you please take some time to review it when you're available? Thank you!

@SbloodyS
Copy link
Member

I have re-fixed the code. Could you please take some time to review it when you're available? Thank you!

The slid issue still exists. You can use the mouse wheel or the keyboard to slide up and down. Part of the lowered button is blocked by sliding.

ZjnOg6S1P3WyYis.png

zhan7236 and others added 6 commits November 27, 2025 06:02
…e buttons are always visible

- Use calc(100vh - Npx) to dynamically calculate editor height based on viewport
- Remove complex flexbox layout that caused infinite scrolling issues
- Reduce Monaco Editor minHeight from 200px to 150px for better small screen support
- Ensure Save and Return buttons remain visible without scrolling on normal screen sizes
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

LGTM

@ruanwenjun ruanwenjun merged commit 5669e4b into apache:dev Dec 4, 2025
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement make more easy to user or prompt friendly UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][dolphinscheduler-ui] the file details display area with large blank space

4 participants