Skip to content

Improve handling of large diffs in WebUI#19320

Open
Sahitya0805 wants to merge 1 commit intoopenSUSE:masterfrom
Sahitya0805:fix/issue-17856-large-diff-handling
Open

Improve handling of large diffs in WebUI#19320
Sahitya0805 wants to merge 1 commit intoopenSUSE:masterfrom
Sahitya0805:fix/issue-17856-large-diff-handling

Conversation

@Sahitya0805
Copy link
Copy Markdown
Contributor

@Sahitya0805 Sahitya0805 commented Feb 19, 2026

Summary

Improve handling of large diffs in the WebUI by ensuring truncation warnings are clearly visible at the point where the diff is cut off.

Problem

Currently, when a diff is truncated in the WebUI, the warning message is not always visible at the exact truncation point.

This makes it unclear to users that the displayed diff is incomplete, especially when scrolling through large files.

Solution

  • Add truncation warning directly at the point where the diff is truncated
  • Use inline logic in existing HAML templates to avoid architectural changes
  • Keep the implementation minimal and scoped to diff rendering

Changes

  • Update HAML views to display truncation warning at the bottom of truncated diffs
  • Ensure no changes to component structure or backend logic
  • Add/update unit test to verify truncation labeling

Verification

Run:

bundle exec rspec spec/components/sourcediff_component_spec.rb

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Feb 19, 2026
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 5 times, most recently from c1dc953 to fcdf2e3 Compare February 23, 2026 16:46
@github-actions github-actions bot added the Documentation 📖 Things regarding our documentation label Feb 23, 2026
@Sahitya0805 Sahitya0805 marked this pull request as draft February 24, 2026 09:44
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 2 times, most recently from 6410e3c to 543112c Compare February 24, 2026 16:17
@github-actions github-actions bot added Backend Things regarding the OBS backend Test Suite / CI 💉 Things related to our tests/CI labels Feb 24, 2026
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 2 times, most recently from f54f0a4 to 04e1c1f Compare February 24, 2026 17:04
@Sahitya0805 Sahitya0805 changed the title Improve handling of large diffs in WebUI Minimal fix for handling large diffs Feb 24, 2026
@Sahitya0805 Sahitya0805 changed the title Minimal fix for handling large diffs Improve handling of large diffs in WebUI Feb 24, 2026
@Sahitya0805 Sahitya0805 marked this pull request as ready for review February 24, 2026 18:03
@Sahitya0805 Sahitya0805 marked this pull request as draft February 24, 2026 18:07
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 5 times, most recently from 728d370 to c5d0168 Compare February 25, 2026 04:51
@Sahitya0805 Sahitya0805 marked this pull request as ready for review February 25, 2026 10:52
@Sahitya0805 Sahitya0805 marked this pull request as draft March 6, 2026 17:50
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch from c5d0168 to ffad473 Compare March 7, 2026 06:47
@Sahitya0805 Sahitya0805 marked this pull request as ready for review March 8, 2026 06:57
Some of the changes are collapsed due to size.
= link_to(request_changes_path(@bs_request, @action, tarlimit: 0)) do
Expand changes
- if truncated? && User.session
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You just switched around the logic from expandable? to truncated?. But this doesn't change any behavior. Especially none of the behaviors requested in #17856

Do you understand what you are doing or do you just page genAI output here?

@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch from ffad473 to fba01c4 Compare March 16, 2026 13:50
@Sahitya0805 Sahitya0805 marked this pull request as draft March 16, 2026 16:41
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 10 times, most recently from b593f6b to 388578a Compare March 23, 2026 17:11
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 3 times, most recently from 51c4b12 to 6d4f503 Compare March 24, 2026 07:55
@hennevogel
Copy link
Copy Markdown
Member

@Sahitya0805 you are mixing bug fixes and refactorings in one PR which makes this very hard to review. See https://medium.com/@kentbeck_7670/bs-changes-e574bc396aaa for an explanation...

@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch 6 times, most recently from 80caf2a to 3281939 Compare March 24, 2026 14:57
- Add repeated truncation warning at the point of truncation (per-file)
- Add bottom-of-page warning in SourcediffComponent for better visibility
- Use inline HAML logic for truncation check to keep classes original
- Remove all unrelated workflow and refactoring noise
@Sahitya0805 Sahitya0805 force-pushed the fix/issue-17856-large-diff-handling branch from 3281939 to 343cad5 Compare March 24, 2026 15:05
@Sahitya0805
Copy link
Copy Markdown
Contributor Author

Sorry, and thanks for the feedback.

You're right the previous version mixed refactoring with the actual fix, which made it harder to review. I've now cleaned up the PR and kept it strictly focused on the intended behavior change.

To clarify the fix:

  • The earlier change (expandable?truncated?) did not introduce any functional difference.
  • The current implementation explicitly checks shown < lines and adds a warning at the truncation point in the UI.
  • This ensures users are clearly informed when a diff is incomplete, addressing the behavior requested in better handling of large diffs in requests #17856.

I've limited the changes to the relevant HAML views and added a unit test to verify the warning is rendered when diffs are truncated.

Please let me know if you'd prefer this to be split further or adjusted in any way.

@Sahitya0805 Sahitya0805 marked this pull request as ready for review March 25, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Things regarding the OBS backend Documentation 📖 Things regarding our documentation Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants