? Language Change Composer Dependency Changed NPM Resource Changed PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
23 Sep 2022

Pull Request for Issue multiple .

Summary of Changes

Replace the very limited javascript used to display the diff between the core and the overriden file in com_templates with something much more useful

Testing Instructions

Apply this PR and then composer install and npm i
or use on of the prebuilt packages

There are two different views for the override: side by side and inline
side by side is the default - you can swtich to the inline version in the component options
both show the line numbers

A message is displayed if the override is identical to the core original file

Actual result BEFORE applying this Pull Request

too ugly to display ;)

Expected result AFTER applying this Pull Request

Default Side By Side View

image

Optional Inline View

image

Identical file View

image

Visible display of tabs and spaces

image

Documentation Changes Required

probably just updated screenshot

More Info

For more information on the library used and possible extras that could be added see https://github.com/jfcherng/php-diff

@richard67 a file is removed - shall I add it to the script or shall I ?

There may be some tweaks to the build scripts required to remove stuff from the library but I can only check when the package is built here ;)

8b6dfdd 22 Sep 2022 avatar brianteeman ,
8818b0a 23 Sep 2022 avatar brianteeman m
5998dbb 23 Sep 2022 avatar brianteeman sql
avatar brianteeman brianteeman - open - 23 Sep 2022
avatar brianteeman brianteeman - change - 23 Sep 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Sep 2022
Category SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation
avatar brianteeman brianteeman - change - 23 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 23 Sep 2022
avatar brianteeman brianteeman - change - 23 Sep 2022
Labels Added: Language Change Composer Dependency Changed NPM Resource Changed ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 Sep 2022
Category SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation SQL Administration com_admin Postgresql com_templates Language & Strings Repository NPM Change JavaScript External Library Composer Change Installation Libraries
avatar brianteeman brianteeman - change - 23 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 23 Sep 2022
avatar brianteeman brianteeman - change - 23 Sep 2022
Labels Added: PR-4.3-dev
avatar Kostelano
Kostelano - comment - 23 Sep 2022

Cool feature!

A "double" border of 1 px on the block, because of this, the frame is thicker than on the blocks above. And an empty space in case we only need to change a couple of lines - it should be removed.

Screenshot_1

avatar brianteeman brianteeman - change - 23 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 23 Sep 2022
avatar brianteeman brianteeman - change - 23 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 23 Sep 2022
avatar Kostelano
Kostelano - comment - 23 Sep 2022

Another suggestion: make the table header fixed when scrolling.

Screenshot_1

avatar brianteeman
brianteeman - comment - 23 Sep 2022

@Kostelano I agree BUT I might have to ask for some help with the css from someone

avatar crystalenka
crystalenka - comment - 24 Sep 2022

@Kostelano I agree BUT I might have to ask for some help with the css from someone

Add to that first row:

position: sticky;
top: 0;

avatar brianteeman
brianteeman - comment - 24 Sep 2022

Not quite that simple.

You can only add it to a th not a tr. But that's not the problem I have. It's messing up all the borders

avatar crystalenka
crystalenka - comment - 24 Sep 2022

If there is nothing in the old column (only difference is code added) the column widths go weird:

Screen Shot 2022-09-24 at 14 22 52

Adding the CSS:

tbody th {
	width: 5%;
}
tbody td {
	width: 45%;
}

Should fix it.

avatar crystalenka
crystalenka - comment - 24 Sep 2022

Not quite that simple.

You can only add it to a th not a tr. But that's not the problem I have. It's messing up all the borders

Applying it to the thead th works. Regarding the borders-something to do with border-collapse on the table: https://stackoverflow.com/questions/50361698/border-style-do-not-work-with-sticky-position-element

avatar brianteeman
brianteeman - comment - 24 Sep 2022

dont forget the css needs to work in both inline and sidebyside

avatar jfcherng
jfcherng - comment - 25 Sep 2022

Those tables have different classes btw.

  • <table class="diff diff-html diff-inline">
  • <table class="diff diff-html diff-side-by-side">
avatar brianteeman
brianteeman - comment - 25 Sep 2022

Thanks Jack - I will probably spend a little time later to create unique css for this using your tip

avatar brianteeman
brianteeman - comment - 25 Sep 2022

will be updated - hopefu;lly soon - with support for displaying tabs and spaces

avatar brianteeman brianteeman - change - 25 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 25 Sep 2022
avatar brianteeman
brianteeman - comment - 25 Sep 2022

everything updated now and ready for further testing.

ANY css changes required should be verified in both modes and submitted as a pr to my branch.

avatar crystalenka
crystalenka - comment - 25 Sep 2022

Looking forward to testing tomorrow, didn't have a chance to be at my computer this weekend beyond a few minutes yesterday otherwise I would have made more concrete comments/a PR. Thanks Brian.

avatar Kostelano
Kostelano - comment - 25 Sep 2022

File Diff Display: Inline - there are problems. In addition to line wrapping, there is a problem with the pinned table header - there is a shift of 1 px when scrolling. Please check - you will understand what I mean.

Screenshot_1

Screenshot_2

avatar brianteeman
brianteeman - comment - 25 Sep 2022

I am offline for the next 48 hours

avatar brianteeman brianteeman - change - 25 Sep 2022
Labels Removed: ?
avatar brianteeman brianteeman - change - 25 Sep 2022
The description was changed
avatar brianteeman brianteeman - edited - 25 Sep 2022
9834133 26 Sep 2022 avatar brianteeman space
avatar uglyeoin
uglyeoin - comment - 26 Sep 2022

Great work thank you @brianteeman happy to test.

avatar uglyeoin
uglyeoin - comment - 26 Sep 2022

HI @brianteeman forgive my newness to this. I tried composer install but it says it's missing a composer.json file. I also tried it in the libraries/vendor/composer directory but no such joy. I searched my install and I find no composer.json files except in Yootheme. Are there any instructions anywhere that I can complete this task? It would seem like it would be a pretty common task.

So I guess I'm onto or "use one of the prebuilt packages". Where do I find them?

avatar brianteeman
brianteeman - comment - 26 Sep 2022

look down and you will see the link to the downloads

image

avatar uglyeoin
uglyeoin - comment - 26 Sep 2022

@brianteeman once I use that file it doesn't show any updated files. Even if I install something with overrides that are out of date it doesn't show them. Or if I create an override that doesn't work either. Is there a better way to test this?

avatar brianteeman
brianteeman - comment - 26 Sep 2022

The diff view is available for any template override it is not restricted to outdated overrides.

Just go to the template manager and create an override. Edit the override and save the edits

Open the override again and top right are two toggle switches - show original and show diff

avatar uglyeoin
uglyeoin - comment - 26 Sep 2022

Oh I see, I was expecting it to be in the updated overrides file part. I see it working, great job, thank you. A million times better.

avatar uglyeoin
uglyeoin - comment - 26 Sep 2022

I have tested this item successfully on 263951f

I see the diff system and it works well


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38823.

avatar uglyeoin uglyeoin - test_item - 26 Sep 2022 - Tested successfully
avatar Kostelano
Kostelano - comment - 27 Sep 2022

@uglyeoin you submitted a successful test but i get this problem. Are you not?

avatar uglyeoin
uglyeoin - comment - 27 Sep 2022

@Kostelano I'm sorry I don't really understand the issue you are having. I have tried looking again and I can't identify it. Please can you provide further information to help me to test. Maybe a short video might help?

avatar Kostelano
Kostelano - comment - 27 Sep 2022

@uglyeoin Pay attention to the column sizes. I have them with the title wrapping to a new line. If I'm not mistaken, the problem is only with parameter File Diff Display in position Inline (I can't double-check right now).

Screenshot_1

avatar uglyeoin
uglyeoin - comment - 27 Sep 2022

@Kostelano how can I choose position inline? My options are:

Show original file yes/no
Show differences yes/no

Have I missed something?

avatar brianteeman
brianteeman - comment - 29 Sep 2022

@uglyeoin yes there is a setting in the template component options that lets you switch from the default side by side view to the inline view that @Kostelano is showing

@Kostelano pretty sure I have fixed the wrap on the headers now

avatar uglyeoin
uglyeoin - comment - 29 Sep 2022

Thanks @brianteeman . I applied the latest patch using patch tester but I still see the columns wrapping as per @Kostelano 's screenshot. Is that the correct way to see the latest version?

I don't need to tell you but this seems to fix it.

.diff-wrapper.diff thead th {
    min-width: 66px;
}
avatar brianteeman
brianteeman - comment - 29 Sep 2022

patchtester can not be used when there are css or js changes. You will need to test with a prebuilt download or the custom update server - both referred to on the same page you had before.

I don't need to tell you but this seems to fix it.

No it won't. It might fix it for en-GB but what if the word in french is much much longer ;)

The changes I made account for that

avatar uglyeoin
uglyeoin - comment - 29 Sep 2022

Ah yes of course, I had forgotten about multilingual. Thanks for the update. I will download and retest.

avatar Kostelano
Kostelano - comment - 29 Sep 2022

@brianteeman yes, now everything is fixed and working well.

Before submitting the test, I would like to make one last suggestion - to indent the columns a little more than 4 pixels (or make the column wider with +/- signs. It seems to me that everything is a little stuck there. Consider this possibility. And I am ready to submit a successful test.

avatar brianteeman
brianteeman - comment - 29 Sep 2022

@Kostelano I am happy with it as it is.

avatar Kostelano
Kostelano - comment - 29 Sep 2022

I have tested this item successfully on a0538fc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38823.

avatar Kostelano Kostelano - test_item - 29 Sep 2022 - Tested successfully
avatar ghazal
ghazal - comment - 5 Oct 2022

I have tested this item successfully on a0538fc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38823.

avatar ghazal ghazal - test_item - 5 Oct 2022 - Tested successfully
avatar richard67 richard67 - change - 5 Oct 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 5 Oct 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38823.

avatar richard67
richard67 - comment - 5 Oct 2022

@HLeithner Drone fails cloning the repo and complains in the log about no IP-V4 address being available in the address pool (or something like that): https://ci.joomla.org/joomla/joomla-cms/58363 . Do you have an idea what the problem could be? I think it's not related to this PR.

avatar obuisard obuisard - change - 9 Oct 2022
Labels Added: ? ?
avatar obuisard obuisard - change - 9 Oct 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-10-09 17:04:41
Closed_By obuisard
avatar obuisard obuisard - close - 9 Oct 2022
avatar obuisard obuisard - merge - 9 Oct 2022
avatar obuisard
obuisard - comment - 9 Oct 2022

Thank you Brian for this major improvement. Makes a huge difference!

avatar brianteeman
brianteeman - comment - 9 Oct 2022

woohoo

avatar brianteeman
brianteeman - comment - 9 Oct 2022

thanks are really for @jfcherng he wrote the code I just implemented it into Joomla

avatar uglyeoin
uglyeoin - comment - 10 Oct 2022

Thanks @brianteeman and @jfcherng :)

avatar RickR2H
RickR2H - comment - 9 Mar 2023

@brianteeman Just Double checking. I create an override and added some text. For some reason the whole compare area is colored. At first the added line was darker green after adding a second line. the darker color is gone. I'm on windows.

screen shot 2023-03-09 at 17 16 55

Just saving the override without adding text will add the full color background.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38823.
avatar brianteeman
brianteeman - comment - 9 Mar 2023

This is what I have for the same changes

image

avatar RickR2H
RickR2H - comment - 9 Mar 2023

I just checked out the 4.3 branch and did an install. I'm curious what went wrong in my installation... I'll check tomorrow.

avatar jfcherng
jfcherng - comment - 9 Mar 2023

the line ending changed?

avatar RickR2H
RickR2H - comment - 9 Mar 2023

Brian is on Windows too. Line endings shouldn't be the problem I guess.

avatar jfcherng
jfcherng - comment - 9 Mar 2023

Just saving the override without adding text will add the full color background.

not sure whether he was aware of this "saving" step.

avatar RickR2H
RickR2H - comment - 10 Mar 2023

Did some further investigation. When I edit the file in VScode the diff works. When I edit and save the override in Joomla the color problem occurs.

diff-colors

@brianteeman Hope you have a tip or a fix. IMHO this is the most useful new feature in J4.3.

avatar jfcherng
jfcherng - comment - 10 Mar 2023

I have strong feeling that this is a line ending issue. If it is, @brianteeman can rtrim($line, '\r\n') before sending to the diff lib. Or maybe I can add a new option to ignore line ending in my diff lib.

avatar brianteeman
brianteeman - comment - 10 Mar 2023

@jfcherng I understand what you are saying but its odd that I cant replicate this

avatar RickR2H
RickR2H - comment - 10 Mar 2023

@brianteeman if you create a new PR, please let me know so I do the tests!

avatar jfcherng
jfcherng - comment - 10 Mar 2023

Maybe ask @RickR2H to look up what's actually stored in the database?

avatar brianteeman
brianteeman - comment - 10 Mar 2023

@RickR2H please open a new issue with this report. that will get more visibility. Don't have time to look at it today.

Add a Comment

Login with GitHub to post a comment