Opened 11 years ago

# Preview button

Reported by: Owned by: Ryan J Ollos Gasler Radu normal WikiReplacePlugin normal preview changes Steffen Hoffmann 0.11

### Description

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

### comment:1 follow-up:  3 Changed 11 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 follow-up:  4 Changed 11 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 11 years ago by Gasler Radu

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 ; follow-ups:  5  9 Changed 11 years ago by Gasler Radu

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 ; follow-up:  7 Changed 11 years ago by Ryan J Ollos

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.

### comment:6 follow-up:  8 Changed 11 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.

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

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 ; follow-up:  10 Changed 11 years ago by Gasler Radu

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 ; follow-up:  11 Changed 11 years ago by Gasler Radu

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 11 years ago by Steffen Hoffmann

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 11 years ago by Ryan J Ollos

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