Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !6610

Merged
Created Mar 24, 2014 by Administrator@rootOwner

Refactor Parallel Diff feature and add scrollbars

  • Overview 18
  • Commits 1
  • Changes 4

Created by: GeorgeDewar

Currently, the Parallel Diff feature can't seem to handle lines that exceed the width of each of the two diff panes.

old_diff_example

Most parallel diff implementations I have seen (e.g. in IDEs) solve this problem by allowing synchronized horizontal scrolling (i.e. both sides scroll together).

I have implemented this by moving to a three-column div layout for the feature, with each side in its own horizontally-scrolling div (I don't think it was possible to do this with the original layout, with one full line in each table row).

So that the horizontal scroll bars are accessible, I've made the diff pane a fixed height, which scrolls vertically. The result seems to work fine in recent versions of Chrome, Firefox and IE.

new_diff_example

In doing this change, I felt that having so much logic in the view (_parallel_view.html.haml) was constraining the layout of the page, and so it seemed appropriate to pull it out as Ruby code (which is currently, perhaps inappropriately, in the helper) and expose a data structure to the view that it could display easily in any HTML structure, removing the burden of processing from the view.

I'm interested in hearing feedback on this.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/Datacom/feature/parallel_diff_scrollbars_pr2