Skip to content

Split diff unexpectedly switches to unified mode on first expansion #36323

@tyroneyeh

Description

@tyroneyeh

Description

When viewing commit history diffs in split mode for the first time, expanding additional context causes the diff view to unexpectedly switch to unified mode.

As a result, the right-side diff content is collapsed into the left side, breaking the split-view layout and making the comparison difficult to read.


Steps to Reproduce

  1. Open any repository on Gitea
  2. Go to Commits
  3. Click a commit to view its diff
  4. Ensure the diff view is in Split mode
  5. Click "Expand diff" / "Show more context" on any file
  6. Observe the diff layout after expansion

Expected Behavior

  • The diff should remain in split mode
  • Left and right panes should stay aligned
  • Expanding context should not change the diff mode

Actual Behavior

  • The diff switches to unified mode
  • Right-side diff content is merged into the left pane
  • The split layout is effectively broken after expansion

Gitea Version

1.26.0+dev-209-g26602fd207

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image Image

Git Version

No response

Operating System

Linux

How are you running Gitea?

OpenRC or command-line

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions