New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic switching of the edit database cell mode according to data type #1537

Closed
mgrojo opened this Issue Sep 20, 2018 · 10 comments

Comments

Projects
None yet
5 participants
@mgrojo
Copy link
Contributor

mgrojo commented Sep 20, 2018

Describe the new feature

This was already mentioned in other issues, but it deserves its own entry.

The editor mode of the Edit Database Cell should take advantage of the data type detection and switch automatically each time a cell is selected or a new data is imported. The user must still be able to switch the mode manually.

Subjects to discussion:

  • Should we provide a way to disable the automatic switch so the user can easily navigate through the cells using a mode which is not the preferred? For example, sticking to the XML mode while viewing an SVG column or to binary mode in a text column for inspecting special characters.
  • If so, how should be disabled? A checkable button besides the mode combo box? Using a wand
    imagen (representing the automagical switch) or a lock imagen imagen (representing that the mode is locked to the last user selection, or not)?

Additional info

Is your feature request related to an issue? Please include the issue number.

This was already mentioned in #1438

As you DO detect what's in a cell, why not change the edit mode to match when a cell is selected?
If I click on a JPEG cell (i have one), why not make the edit mode switch to image automagically?

And in #1173

It would be great if text values are automatically checked for being parseable as JSON (if they are less than e.g. 100KB), and then the editor automatically switches to JSON.

Does this feature exist in another product or project? Please provide a link.

Probably. It isn't something revolutionary.

Do you have a screenshot? Please add screenshots to help explain your idea.

No screenshot. Use your imagination 😄

@mgrojo mgrojo added the enhancement label Sep 20, 2018

@mgrojo mgrojo self-assigned this Sep 20, 2018

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 20, 2018

Yeah, if we implement this well it would probably improve usability. 😄

We'd still need the drop down thing so people can manually override the selection too (eg change to binary view). At a guess this shouldn't be too hard to get working at least initially.

@mgrojo

This comment has been minimized.

Copy link
Contributor Author

mgrojo commented Sep 21, 2018

I have the changes for automatically switching the mode after selecting a cell and after importing new data from a file. The user can still switch the mode manually after that.

I want to implement now the checkable button for disabling/enabling the automatic switch. I think I'm going to use the wand icon for it. I'm thinking on using the cog (off) imagen and cog_go (on) imagen icons that we are already using in other contexts.

mgrojo added a commit that referenced this issue Sep 21, 2018

Automatic switching of the editor mode according to data type #1537
A new checkable button and associated setting is added for automatically
switching the editor mode in the Edit Database Cell dock in accordance to
the loaded data. The switch is done after loading data from cell, after
importing new data to the cell and when checking the button.

If the button is unchecked the behaviour is as formerly.

Since XML is not currently detected, the mode only changes to XML when SVG
is supplied.

Default value is true, since the new behaviour is considered more useful
for the general case.
@mgrojo

This comment has been minimized.

Copy link
Contributor Author

mgrojo commented Sep 21, 2018

It's now committed in the master branch.

imagen

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 21, 2018

Awesome @mgrojo, looks good. Well placed & appropriate icon (etc). 😄

I'll probably have time to get the nightlies server working again in a few days, which should help get this out to people too. 😄

@mgrojo

This comment has been minimized.

Copy link
Contributor Author

mgrojo commented Sep 26, 2018

@tlhackque and @wmertens, you might like to try this new feature that both of you proposed in the referred issues. It is now available in the latest nightly build.

@chrisjlocke

This comment has been minimized.

Copy link
Contributor

chrisjlocke commented Oct 16, 2018

@tlhackque and @wmertens ... cough

@tlhackque

This comment has been minimized.

Copy link

tlhackque commented Oct 16, 2018

Have not forgotten, but have been away.

Expect to catch up later this week.

I appreciate the effort - sorry about the bad timing.

@chrisjlocke

This comment has been minimized.

Copy link
Contributor

chrisjlocke commented Oct 16, 2018

No problem - whenever is convenient. 😸

@wmertens

This comment has been minimized.

Copy link

wmertens commented Oct 16, 2018

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Feb 7, 2019

Closing this, as it seems to be complete. 😄

@justinclift justinclift closed this Feb 7, 2019

mgrojo added a commit that referenced this issue Feb 9, 2019

Detect XML data starting with a declaration
Checking for "<?xml" at the beginning of a text is a quick and simple test
that will detect most of the XML cases.

This fills an obvious gap in #1537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment