Skip to content

Fix #1004 - #1005

Merged
boomzero merged 2 commits into
XMOJ-Script-dev:extern-contribfrom
zsTree0830:dev
Aug 6, 2026
Merged

Fix #1004#1005
boomzero merged 2 commits into
XMOJ-Script-dev:extern-contribfrom
zsTree0830:dev

Conversation

@zsTree0830

@zsTree0830 zsTree0830 commented Aug 6, 2026

Copy link
Copy Markdown
Member

What does this PR aim to accomplish?:

Fix #1004

How does this PR accomplish the above?:

Add height style for #CompareElement .monaco-merge-host in L4973-L4975


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributor's guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented on my proposed changes within the code.
  3. I have tested my changes.
  4. I am willing to help maintain this change if there are issues with it later.
  5. It is compatible with the GNU General Public License v3.0
  6. I have squashed any insignificant commits. (git rebase)
  7. I have checked that another pull request for this purpose does not exist.
  8. I have considered and confirmed that this submission will be valuable to others.
  9. I accept that this submission may not be used, and the pull request can be closed at the will of the maintainer.
  10. I give this submission freely and claim no ownership to its content.
  11. I have verified that my changes work correctly in both the new UI and the old/classic UI.

  • I have read the above and my PR is ready for review. Check this box to confirm

Summary by Sourcery

Enhancements:

  • Inject a style override so that the #CompareElement .monaco-merge-host element uses a fixed relative height within the compare view.

Summary by cubic

Sets a fixed height for the Monaco merge editor in the compare view to prevent clipping and empty space, fixing #1004. Injects a style that sets #CompareElement .monaco-merge-host { height: 95%; }.

Written for commit ef0ecbb. Summary will update on new commits.

Review in cubic

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a scoped CSS rule to adjust the height of the Monaco merge editor inside the compare element so the diff viewer fits within the fixed-height container.

Flow diagram for injecting Monaco merge host height style

flowchart TD
    A[Render CompareElement div with fixed height] --> B[Create compareElementStyle using document.createElement]
    B --> C["Set textContent to #CompareElement .monaco-merge-host { height: 95%; }"]
    C --> D[Append compareElementStyle to document.head]
    D --> E[Monaco merge editor height constrained within CompareElement]
Loading

File-Level Changes

Change Details Files
Inject a style element to control Monaco merge editor height inside the compare view container.
  • Create a <style> element in the compare view setup code
  • Set its textContent to apply a 95% height to '#CompareElement .monaco-merge-host'
  • Append the style element to document.head so the Monaco diff editor respects the container height
XMOJ.user.js

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

@boomzero
boomzero merged commit 89f980a into XMOJ-Script-dev:extern-contrib Aug 6, 2026
@zsTree0830
zsTree0830 deleted the dev branch August 6, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Compare Source Editor 高度值太小

2 participants