Modify

Opened 13 years ago

Last modified 13 years ago

#9750 new enhancement

Preview button

Reported by: Ryan J Ollos Owned by: Gasler Radu
Priority: normal Component: WikiReplacePlugin
Severity: normal Keywords: preview changes
Cc: Steffen Hoffmann Trac Release: 0.11

Description

There should be a preview button that shows which pages will have replacements made.

Attachments (2)

Feedback1.png (5.3 KB) - added by anonymous 13 years ago.
Feedback2.png (10.1 KB) - added by anonymous 13 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 13 years ago by Ryan J Ollos

I'm ready to provide a patch for this, or can push the change directly to the repository if it's okay with the plugin author.

comment:2 Changed 13 years ago by Ryan J Ollos

Cc: Steffen Hoffmann added; anonymous removed

This plugin seems incredibly useful and I haven't found anything else like it on Trac-Hacks. I think the preview button is important, since a plugin like this has the potential to do a lot of damage. However, I'm expecting the plugin is pretty stable since this is now the only open ticket.

I have some questions about how the replacements are done, which I will try to sort out and document on the project's wiki page. For example, if I input a into the Find field and b into the Replace field, every occurrence of the character a will be replaced with b, which was a bit unexpected. I was expecting that a and b would be treated as words, unless a regular expression or glob was provided.

comment:3 in reply to:  1 Changed 13 years ago by Gasler Radu

Replying to rjollos:

I'm ready to provide a patch for this, or can push the change directly to the repository if it's okay with the plugin author.

Hi rjollos, I would be very glad if you could provide this patch. You can push the change directly to the repository.

comment:4 in reply to:  2 ; Changed 13 years ago by Gasler Radu

Replying to rjollos:

This plugin seems incredibly useful and I haven't found anything else like it on Trac-Hacks. I think the preview button is important, since a plugin like this has the potential to do a lot of damage. However, I'm expecting the plugin is pretty stable since this is now the only open ticket.

I have some questions about how the replacements are done, which I will try to sort out and document on the project's wiki page. For example, if I input a into the Find field and b into the Replace field, every occurrence of the character a will be replaced with b, which was a bit unexpected. I was expecting that a and b would be treated as words, unless a regular expression or glob was provided.

Yes, you're right, the replace form is not very intuitive right now. We could provide a set of options for the replace mode like: regular expression/glob, match whole words, case sensitive.

comment:5 in reply to:  4 ; Changed 13 years ago by Ryan J Ollos

Replying to miezuit:

Yes, you're right, the replace form is not very intuitive right now. We could provide a set of options for the replace mode like: regular expression/glob, match whole words, case sensitive.

I will plan to do some work on that eventually. I think I can add a patch for preview mode in the near future. Is it okay if I push changes straight to the repository and ask for your code review? I'll follow up quickly with any changes that need to be made.

Changed 13 years ago by anonymous

Attachment: Feedback1.png added

Changed 13 years ago by anonymous

Attachment: Feedback2.png added

comment:6 Changed 13 years ago by Ryan J Ollos

One of the things I've been considering is how the list of wiki pages will be displayed. A quick and easy way to do this would be to use add_notice or add_warning from trac.web.chrome. However, I don't think this will work well for a long list of pages, so we may want come up with a nice way to display the list as a permanent solution.

add_warning example:

add_notice example:

comment:7 in reply to:  5 Changed 13 years ago by Gasler Radu

Replying to rjollos:

Replying to miezuit:

Yes, you're right, the replace form is not very intuitive right now. We could provide a set of options for the replace mode like: regular expression/glob, match whole words, case sensitive.

I will plan to do some work on that eventually. I think I can add a patch for preview mode in the near future. Is it okay if I push changes straight to the repository and ask for your code review? I'll follow up quickly with any changes that need to be made.

Yes, of course. It's no problem. Just go for it.

comment:8 in reply to:  6 ; Changed 13 years ago by Gasler Radu

Replying to rjollos:

I was also thinking about something more fancy (but don't know yet if it's possible) like displaying all replacements that were done in the wiki pages as a changeset with diffs. Something that would look like, let's say, [11245] but with wiki pages instead of files.

comment:9 in reply to:  4 ; Changed 13 years ago by Gasler Radu

Replying to miezuit:

Replying to rjollos:

Yes, you're right, the replace form is not very intuitive right now. We could provide a set of options for the replace mode like: regular expression/glob, match whole words, case sensitive.

I think we should also create a follow up ticket for the customizable replace mode. Is it ok with you?

comment:10 in reply to:  8 Changed 13 years ago by Steffen Hoffmann

Keywords: preview changes added

Replying to miezuit:

Replying to rjollos:

I was also thinking about something more fancy (but don't know yet if it's possible) like displaying all replacements that were done in the wiki pages as a changeset with diffs. ...

Yes, a basic list would be fine with number of changes in brackets behind each page name. This could be the label for a link to show changes per file, like the list we see today above the diffs. Add a checkbox, to show changes inline below too, because in some situations there might be simply too much to display for a single page to make this the default display mode.

comment:11 in reply to:  9 Changed 13 years ago by Ryan J Ollos

Replying to miezuit:

I think we should also create a follow up ticket for the customizable replace mode. Is it ok with you?

Yeah, that sounds good.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Gasler Radu.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.