Edit documentation in TW and use Github API to create PRs directly?

For anyone who wants to try it so far, drag and drop the following into Saq’s demo page.

Hmm. If this is acceptable, I guess some additional info should be added to notes.

2021-10-28A-Push_PR.json (4.2 KB)

Something strange is going on.

  • I did define a path and clicked the + button.
  • But now the UI is gone.
  • I don’t know what I selected
  • I can’t change it …

Since I don’t know which path I did select I basically have to start from scratch :confused:

As a user I’d expect:

  • It shouldn’t be needed to click the + button to confirm a path for a new tiddler
    • Selecting a path from the dropdown imo is enough confirmation
    • Selecting a path from the dropdown doesn’t activate the “Make PR” button
  • Once I’m done with all paths, I would expect a button eg: “Confirm Settings”
    • near the “Make PR” button.
  • The path settings should be visible and changeable at all times
    • even if the “Make PR” button is active already it should be possible to change paths
    • If a path is changed
      • “Make PR” is disabled and
      • the “Confirm Settings” will be needed again
  • Clicking the “Confirm Setting” button should activate the “Make PR” button

Just some thoughts.

Clicking the button was a commitment to the path. Presumably people will make a conscious choice. But I see your point.

The final “choice” could be moved to the end, next to the PR button.

But the reason you have to make a choice at some point is because it’s using the original paths to determine which items do not have an assigned path. Once you add the selected path (either by individual button or a final choice button), your tiddler becomes just like any other tiddler and so disappears from the listing. The PR button needs to know that OriginalFilePaths is OK before processing, so that’s why there needs to be a “commitment” at some point.

I suppose the “Confirm” button could turn into a “Reset” button, so you could undo your OFP changes, make new selections, etc. Since the selections are maintained in temporary tiddlers, your last path settings should still be there.

Maybe wait and see if there are any other opinions about interface, before spending more hours working on it.

Hi @Mark_S, found the opportunity to take a quick look. Thank you for working on this.

I think this is a good start. Some quick thoughts on potential UI improvements:

  • It would be good to fix the relative column sizes (this is in the ugly table I implemented, not your additions) so they don’t change as one enters data. That can be jarring and potentially confusing.
  • Maybe only show the table row with “Specify file paths” when there is a title that is new is entered into the textarea?
  • I like that you can specify different paths for different tiddlers.
  • Perhaps we get rid of the confirmation for the paths button, enable the “Make a PR” button as long as a path has been selected for all new tiddlers, and update OriginalPaths when the “Make a PR” button is clicked? This would also allow users to see what path they have selected in the select dropdowns and change it if necessary.
  • This is superseded by the above suggestion: It might be nice to have a “show paths” option to show paths for the titles that will be in the PR, in case one wants to double check what was entered before submitting.

Am I correct in thinking that these will require us to jettison the current pipe-based table in favor of an HTML table? Like I don’t think we can provide sizes with the pipe table and think that it’s not possible to wrap a piped row with list/reveal?

Thanks!

@Mark_S I think you’re right, an HTML table would be the way to go about it.

A wikitext table could work for the column widths using a CSS selector like td:first-child but the conditional display for the bottom row would still necessitate HTML.

Do you have an example or a way of recreating this effect? When I load up PR Message, it eventually pushes the box down, but the column size stays the same. The GH token link seems to be locking column 1 down. Of course, we could make it a shorter link if people needed more space. But at least on my desktop there seems to be oceans of space.

BTW, to me it’s not ugly – it’s distraction free :slightly_smiling_face:

One way to trigger it is to try typing a title into the “Tiddlers to include” textarea. The columns resize and it is very jarring. I think there is enough space, rather that the column sizes need to stay constant.

The drag an drop don’t porpose to import anything but to save something.

I have difficulties to figure out what you wants to achieve. From my user point of view, that of a user that want to fix something in a a tiddler of the documentation, the proper way would be:

  1. opening the tiddler to fix
  2. edit it
  3. validate one’s edition
  4. this would trigger the PR setup tiddler which would mostly ask for a comment about what I did
  5. I validate it and presto, PR done, job done, I’m glad at participating.

So far, this is not that yet but I don’t know if that’s what you want to achieve. I’m interested because I have a lot of such PR to propose.

note: step 4 may or may not alter the actual content of the tiddler. it could offer a preview, ask for confirmation and then only show the PR form (without modifying the tiddler – that’s what the PR is for).

The imagined workflow is like:

  1. Fix, and/or create one or more tiddlers
  2. Open the PR form
  3. Provide information: Explain what tiddlers are part of the PR. Add physical file paths for new tiddlers. Add message and title to explain purpose of PR.
  4. Submit form. PR is created.
1 Like

Only tested once. But that’s enough for today. It turns out that I was able to use piped tables by using dynamic CSS. So the JSON has 3 tiddlers now. The button next to the path selection is gone. The PR submit updates OriginalFilePaths – so after that your selection is gone. Oh. Sorry. There’s an anomalous word “yes” at the top of the PR form. Just ignore for now. I don’t want to risk breaking the form by some last minute change.

As before, open Saq’s demo page. Drag and drop the attached.

2021-10-28B-Push_PR.json (6.1 KB)

You’ve posted more than 22% of the replies here, is there anyone else you would like to hear from?

Dang. I was aiming for 42.

That looks pretty good @Mark_S ! Good to know I am not the only one that runs away from HTML tables :stuck_out_tongue:

The only remaining quibble is that when you start typing a new tiddler title into the “Tiddlers to include” textarea, after the first character the field loses focus. A quick peek at the code suggests we just need to move those two $wikify calls closer to where they are actually needed and not wrap them around the entire table.

This might be a preference thing, but maybe the first column can be 200px instead of 100px?

Think it just needs a “tag in a random user” button now.

Please use em to specify the max-width for the first column and use a min width, so the first 4 params fit into the first column without a break. Atm on my laptop screen the table looks ugly at every browser zoom level

OK, I’ve done the test. Well done job.

I have a few suggestion for UI improve:

  • while creating the PR, use a progress bar along with the messages currently generated
  • left column of the table should be less wide. but use em as unit, not px. px is for pictures, em is for text width (the same for default tw setup BTW)
  • right to the “save wiki” icon in the right column of the wiki, would be a very fitting place for a “generate pull request” icon.
  • I’d like to have the system able to generate the list of icon for me, as I edit/create/delete/rename tiddlers and to be able to enable/disable that “pull PR” icon as a result too. I have connected to github before being able to alter things, so I things this should be feasible (this whole paragraph is a suggestion for a later version).

I’m very keen to see this mechanism enabled on the real thing!

A few tweaks. Set column one per em setting. Moved wikify’s closer to targets.

If anything doesn’t look right on your screen, please take a screenshot. Needless to say, everything looks fine on the two screens where I test.

2021-10-29A-Push_PR.json (6.1 KB)

@Mark_S in terms of UI I think this resolves all immediate niggles and issues and feels usable.

It does seem that the path isn’t quite right when using the tiddlers (standard) option for new tiddlers. It results in paths like:
editions/tw5.com/tiddlers/tiddlers/Notes 1.tid when
editions/tw5.com/tiddlers/Notes 1.tid
is expected, see this PR.

Once that is resolved I’ll update the repo with your changes. Thank you for working on this.

See if this works better

2021-10-29B-Push_PR.json (6.1 KB)

That looks good! See new test by saqimtiaz · Pull Request #36 · saqimtiaz/TiddlyWiki5 · GitHub

I will add this to the git repo (which will mean it goes live on the demo) as soon as I get the chance this weekend.

I have added @Mark_S’s changes to the repo and the demo should now be updated with them.

Thank you Mark!

To make a real PR against the main TW repo, change the text of $:/config/sq/makepr/repoOwner to jermolene use the select dropdown in the table to choose “official TW repo”.

When I attempted to submit these items in one batch:

[[ActionCreateTiddlerWidget Example]] [[ActionCreateTiddlerWidget Example 2]] [[ActionCreateTiddlerWidget Example 3]] [[ActionCreateTiddlerWidget Example 4]] [["muritest" by Simon Huber] [["TiddlyServer" by Matt Lauber]] [["Noteself" by Danielo Rodríguez]] [["Encrypt single tiddler plugin" by Danielo Rodriguez]] [["Dynamic Tables" by Jed Carty]]

The form omitted to include two of them: “muritest”, and “TiddlyServer”.