Feature SS-2381
1 vote

[Writer Region]: Open link target in same SMath instance

Created by Martin Kraska on 9/2/2016 6:29 PM Last Updated by Davide on 9/17/2016 12:48 AM
Logged: 0   (hrs)


For consistency with the standard text region and for usability within interactive handbooks, I propose changes:

If a hyperlink with file target in a text region is Ctrl-clicked, then the target is opened in a new SMath instance. Recently, SMath switched to pre-loading the plugins, this practically prevents fast browsing through interlinked SMath documents (like the interactive handbook). The proposal is to make the behaviour consistent to the standard text region, where the document is replaced by the link target, which is fast and convenient (and safe, due to the check for changes).

Also, please make relative file paths relative to the document directory, not to the current directory (otherwise documents with relative links would need a mandatory CurrentDirectory(DocumentDirectory()) statement.

    Davide (Saturday, September 3, 2016 8:45 PM) #

Relative paths vs multiple worksheets fixed, thank you! (plugin updated)

    Martin Kraska (Saturday, September 3, 2016 12:56 PM) #

Action on following links: Leaving the choice to the user of what to do when following a link is a good idea as long as the defaults aren't annoying. When browsing the handbook, the default action should be document replacement (with a functional back button). This might be a good choice in general. Additionally, you might offer a context menu item like open in new instance. Also, there might be a global option to set the default.

Relative paths: The relative paths are stored correctly but the links don't work if the current directory isn't the document directory. This easily happens if you work with multiple documents at a time. The proposal is to use the document directory as base for relative links, not the current directory when links are followed. Example: If you set the current directory in file A to document directory (e.g. because you want to read a file with relative pathname) and then open file B, then relative links in file B won't work (unless B resides in the same directory as A). If students work on a project and then look up in the interactive handbook, then they find the links not working. Workaround is to open a new SMath instance and call the interactive book there. This looks like an annoying bug to them, as the [?] button directs to something which is not working.


    Davide (Friday, September 2, 2016 7:20 PM) #

I've talked about this with Andrey some time ago. If I remember correctly the final proposal was to introduce SMath side an approach like the one used in browsers (open a new instance, open a document in the same insatance, ...); currently is not yet implemented, but it is planned (good to have it tracked).


As for the 2nd point, I miss the problem. Currently the behavior is the following:

- until the document doesn't exists (brand new, not yet saved), the absolute path is stored;

- once the file is saved somewhere, relative paths are used;