Modify

Opened 3 years ago

Last modified 3 years ago

#9750 new enhancement

Preview button

Reported by: rjollos Owned by: miezuit
Priority: normal Component: WikiReplacePlugin
Severity: normal Keywords: preview changes
Cc: hasienda 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 3 years ago.
Feedback2.png (10.1 KB) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 follow-up: Changed 3 years ago by 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.

comment:2 follow-up: Changed 3 years ago by rjollos

  • Cc hasienda added

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 3 years ago by miezuit

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 ; follow-ups: Changed 3 years ago by miezuit

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 ; follow-up: Changed 3 years ago by 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.

Changed 3 years ago by anonymous

Changed 3 years ago by anonymous

comment:6 follow-up: Changed 3 years ago by rjollos

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 3 years ago by miezuit

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 ; follow-up: Changed 3 years ago by 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. Something that would look like, let's say, [11245] but with wiki pages instead of files.

comment:9 in reply to: ↑ 4 ; follow-up: Changed 3 years ago by miezuit

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 3 years ago by hasienda

  • 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 3 years ago by rjollos

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.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.