tablacus / TablacusExplorerAddons

Add-ons for Tablacus Explorer
http://tablacus.github.io/TablacusExplorerAddons/
MIT License
87 stars 12 forks source link

bblackmoor UI 351 #352

Closed bblackmoor closed 1 year ago

bblackmoor commented 1 year ago

Unify captions in 3 add-ons #351

https://github.com/tablacus/TablacusExplorerAddons/issues/351

bblackmoor commented 1 year ago

AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec);

If you change this, the compatibility of the person who is currently using it will be damaged, so it will be rejected.

I understand. I will look into this in more detail.

bblackmoor commented 1 year ago

tl;dr -- @tablacus ... Respectfully, what will break if a hyphen is added to the second parameter of AddTypeEx("Add-ons", "Add-ons updater", Addons.AddonsUpdater.Exec); ?

long version...

@tablacus said this about the "addons to add-ons" edit:

AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec);

If you change this, the compatibility of the person who is currently using it will be damaged, so it will be rejected.

The initial text of TablacusExplorerAddons\addonsupdater\script.js is AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec);

The proposed change in TablacusExplorerAddons\addonsupdater\script.js is: AddTypeEx("Add-ons", "Add-ons updater", Addons.AddonsUpdater.Exec);

Looking at the function:

AddTypeEx = function (strType, strTitle, fn) { const type = g_basic.FuncI(strType); if (type && type.Cmd) { api.ObjPutI(type.Cmd, strTitle, fn); } };

I thought strTitle was title text, to be displayed (and translated, if an entry for the text exists in the user's language).

Test #1: "Add-ons updater" is current; "Side tree view" is old.

1) I closed Tablacus Explorer. 2) I manually changed Tablacus\addons\addonsupdater\script.js in my test environment like so: From AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec); To AddTypeEx("Add-ons", "Add-ons updater", Addons.AddonsUpdater.Exec); 3) I reverted "Side tree view" in my test environment to Version 1.24 (2021-09-05) 4) I opened Tablacus Explorer. 5) Under Tools >> Options >> Add-ons, I enabled the "Side tree view" add-on, and clicked "Okay". 6) I selected Help >> Check for updates. It appeared to operate as expected. 7) Under Tools >> Options >> Add-ons, I selected "Side tree view". It now shows the updated "Height" control. "Side tree view" version is now

image

Test #1 appears to be successful.

Test #2: "Add-ons updater" is old; new version of "Add-ons updater" has a hyphen in the AddTypeEx() call

I would like to test this to see if "Add-ons updater" would update itself correctly to the revised AddTypeEx() call, which has an added hyphen in the strTitle parameter of AddTypeEx, but I do not know of a convenient way to test that. I would need to redirect the update check to compare with a test rather than the production repository.

However, I can add a hyphen in the test environment, and see if this causes a problem during the update. I will test the effect of a hyphen on the update of an add-on, as well. I chose "Address bar".

1) I closed Tablacus Explorer. 2) I reverted "Add-ons updater" in my test environment to Version 1.09 (2021-01-17). 3) I reverted "Address bar" in my test environment to Version Version 1.68 (2021-05-07). 4) I manually added a hyphen to "addon" in the "Add-ons updater" files in my test environment. For example, in script.js: From AddTypeEx("Add-ons", "Addons updater", Addons.AddonsUpdater.Exec); To AddTypeEx("Add-ons", "Add-ons updater", Addons.AddonsUpdater.Exec); 5) I manually added a hyphen to "address" in the "Address Bar" files in my test environment. For example, in script.js: From AddTypeEx("Add-ons", "Address Bar", Addons.AddressBar.Exec); To AddTypeEx("Add-ons", "Add-ress Bar", Addons.AddressBar.Exec);

NOTE: We now have two add-ons which are out of date: "Add-ons updater" and "Inner Address Bar". Both of these have been manually revised to add a hyphen ("add-on" and "add-ress"). We will now test to see if "Add-ons updater" will correctly update itself and "Inner Address Bar" to the current versions, which do not have hyphens

6) I opened Tablacus Explorer. 7) Under Tools >> Options >> Add-ons, I confirmed that "Add-ons updater" and "Add-ress Bar" are enabled, have hyphens, and are old versions (1.09, 1.68). 8) I selected Help >> Check for updates. It appeared to operate as expected. 9) Under Tools >> Options >> Add-ons, I confirmed that "Add-ons updater" and "Address Bar" are enabled, not have the added hyphens, and are current versions (1.10, 1.70).

This seems to work as intended.

@tablacus ... Respectfully, what will break if a hyphen is added to the second parameter of AddTypeEx("Add-ons", "Add-ons updater", Addons.AddonsUpdater.Exec); ?

ccfs commented 1 year ago

@bblackmoor,

I believe that "Help > Check for updates" invokes the add-on directly and NOT through the "Addons updater" command (regardless of the hyphen).

To invoke an add-on command, you need to create a record in Tool bar add-on / Key add-on / menu, then click the button / press the key / choose the menu option.

image

The button / key / menu option will not work after the proposed change is rolled out, if the user does not update the record accordingly. I know this side effect before I request for the change.

Since the 3 add-ons already provide a good default way for direct access (menu option), I believe that very few persons (probably none) will invoke them through add-on commands. Therefore the change worths the risk.

If the change is rejected, the inconsistent captions will remain and just cause some dirty works to translators (me). General users are not affected anyway.

ccfs commented 1 year ago

@bblackmoor, thank you very much for your effort and sorry for your time wasted. Regards,