Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve changes presentation for non-technical users #10

Open
hughbris opened this issue May 18, 2022 · 17 comments
Open

Improve changes presentation for non-technical users #10

hughbris opened this issue May 18, 2022 · 17 comments
Labels
enhancement New feature or request

Comments

@hughbris
Copy link
Owner

I've done some work pulling up an object-like array, but it retains git symbols like "D", "?", "M" that need translating. Started a combobulate function/method that I might use to translate those codes for users. I also want to mention renames and did some work towards returning that information from status.

I'll try to spec the UI out better when I have some time.

@hughbris hughbris added the enhancement New feature or request label May 18, 2022
@hughbris hughbris changed the title Show type of git change detected Improve changes presentation for non-technical users May 24, 2022
@hughbris
Copy link
Owner Author

I'd like to present editors with a table-like summary of changes including the following details in plain language (translateable ideally):

  • type of change
  • page title (we have a path, should be a way to grab this using Grav)
  • number of additions, changes, deletions in file (might need a richer Git lib)
  • date changed (? - nice to have, probably rarely useful)

The ultimate UI I envisage has dropdowns on each changed entry (like Admin's Plugin list) which shows a full coloured diff with selectable hunks, as well as renames. Aim high!

@pamtbaau
Copy link
Collaborator

And maybe the user.name and/or user.email in the list of changes?

@hughbris
Copy link
Owner Author

Do you mean

  • an override for the overall commit? or
  • which Admin user made each change?

I suspect the first. I like that one, not sure if the second one is recorded by Grav. Also I envisage one editor per installation but that's just me imposing my norms.

@pamtbaau
Copy link
Collaborator

I presumed you wanted to present the Admin user a commit history per page, which could be handy.

I now realise you probably want a detailed overview of the page before publishing it. In that case, Grav itself isn't providing the name of the user who edited the page. However... the blueprint for the page can be changed in order to automatically save the user's name/email in the frontmatter of the page.

@hughbris
Copy link
Owner Author

hughbris commented Jun 1, 2022

@pamtbaau do you know if there's an equivalent to page.find() for the actual filesystem path (the one Git sees) ?

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 1, 2022

Uhm... what exactly are you trying to achieve? I'm missing a bit of context.

@hughbris
Copy link
Owner Author

hughbris commented Jun 2, 2022

Oh to present the page title and link to the page in the improved display. Item 2 in my wishlist above. That was the context, sorry. I think that's much friendlier than a filesystem path.

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 2, 2022

Ah yes, that's indeed an improvement for the user. I'll have a look at it.

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 2, 2022

Would something like this cut it?

User can:

  • Open page on local site in new tab (preview)
  • Open page in Admin in new tab (edit)

Untitled

@hughbris
Copy link
Owner Author

hughbris commented Jun 6, 2022

That's a big improvement on what's there now. I hadn't thought of an edit link. I would prefer the title is hyperlinked with a new window-type icon adjacent than the eye.

However, bear in mind I would eventually like users to be able to drop down a side-by-side diff display, as well as the information mentioned in earlier comments (especially change type, I am conscious that files that are renamed and edited might be confusing, and this can easily happen through Admin plugin).

Also, we can't assume every change is a page.

But sure, if you don't mind putting time into an interim display, go for it. Thank you!

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 6, 2022

I would prefer the title is hyperlinked with a new window-type icon adjacent than the eye.

Something like this?
Untitled

Also, we can't assume every change is a page.

RequestHandler doesn't assume anything. It returns anything that PushyRepo returns as changed item. Only when item is in the /pages/ folder, it will lookup the title and external url.

Unfortunately, in RequestHandler, I had to fake a config item, because the PushyRepo seems not to be returning anything other then changed pages, while $ git status does show config changes.

@hughbris
Copy link
Owner Author

hughbris commented Jun 7, 2022

Something like this?

That's exactly it!

RequestHandler doesn't assume anything. It returns anything that PushyRepo returns as changed item. Only when item is in the /pages/ folder, it will lookup the title and external url.

Perfect.

Unfortunately, in RequestHandler, I had to fake a config item, because the PushyRepo seems not to be returning anything other then changed pages, while $ git status does show config changes.

Add something like config to the Pushy YAML under folders.

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 7, 2022

Add something like config to the Pushy YAML under folders.

Tried that for sure! But, I'm more dafted than I thought... The config file is at the top of the list which I hadn't noticed...

Will do some chores and push the branch.

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 7, 2022

Pushed branch 'feature-page-titel'

NB. You might consider changing the ordering of items returned by PushyRepo. Grouping by item type (page, config, data, ...) might be a tad better. The following returned list isn't that neat:

  • config/system.yaml
  • Home
  • Child page
  • Typography
  • config/plugins/pushy.yaml

@hughbris
Copy link
Owner Author

hughbris commented Jun 13, 2022

You might consider changing the ordering of items returned by PushyRepo

I forgot to mention I looked at Git options for this and there don't seem to be any! Moreover, I'm curious what the order is.

So this might have to be sorted by PHP.

@pamtbaau
Copy link
Collaborator

pamtbaau commented Jun 13, 2022

I think Git status will return the changed items ordered by path.

Server:
Since ChangedItem already has fields type, title, path, the ChangedItems array class could implement a sort method to sort list of items by type and depending on the type sort further by title or path.

Client:
The current single table of changed items could be split into multiple tables based on the type of item.

On the other hand... Media (and possibly media meta data files) belonging to a page might be better shown together with the page itself since they form some kind of a unit of work. A little indentation of images might be sufficient.

  • Home
  •      header.jpg
  • Typography
  •      image1.jpg
  •      image2.jpg

@hughbris
Copy link
Owner Author

A little indentation of images might be sufficient.

I overlooked this until now. That indentation layout is very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants