vanstyn / RapidApp

Turnkey ajaxy webapps
http://rapi.io
Other
48 stars 15 forks source link

Adding Shorten Tabs feature and fixing some more bugs around the tab #140

Closed Getty closed 9 years ago

Getty commented 9 years ago

title and its dropdown. First I fixed the "Close other Tabs" menu to be really not shown when there is no other tab open. I also added "Close Tab" to allow to close the tab without actually reaching the top right X. After that I reached out to understand how RapidApp constructs the TabPanel, which leaded me to Module::Explorer, which I extended with a shorten_tab_titles attribute, which can easily be set on the Catalyst::Plugin::RapidApp::TabGui configuration. If activated, we add a div around the title with the class ra-shorten-tab-titles, which uses CSS to shorten the visual. Still, when you right-click the menu will show you the full title, and it will even word-wrap this title, so that you are able to see it all even if its much longer as the screen. I also added filtering out of returns and br's for the title, to not get a 2 lines tabpanel.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.01%) to 50.94% when pulling b0383da203bb32857cdb24da3574a7a2bc88b08d on getty/shortentabs into 4605953ea1c303e60ebfc6732d5d2052a19f35c3 on master.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.01%) to 50.94% when pulling 979cf2f764a1fcf6831854b29307323221b26861 on getty/shortentabs into 4605953ea1c303e60ebfc6732d5d2052a19f35c3 on master.

vanstyn commented 9 years ago

This is a fine implementation, however, after thinking about it, I'd like there to be a "tab_title_max_width" param with a sane, default value, rather than a boolean switch which enables a hard-coded value. This option should it work like the following:

  1. This should be a new param in Ext.ux.RapidApp.AppTab.TabPanel (in 084-AppTab.js#L38) with a default value of, say, 300 px
  2. It should also be an attr of the same name in RapidApp::Module::Explorer which passes through to set the option (in the content_area cfg hash at/about Explorer.pm#L212)
  3. It should also be an option of the same name which can be set in the $c->config->{'Plugin::RapidApp::TabGui'} which passes through in kind to RapidApp::Module::Explorer
Getty commented 9 years ago

Done

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.01%) to 50.93% when pulling 9e81288f2fa5315b254567ea7ac91ad3b6f36ced on getty/shortentabs into ed669d749989bc6f0e3b3caebacf651a3fd5ac80 on master.

vanstyn commented 9 years ago

So, of course after I approve the merge is when I find the problem... There is a bug with this change regarding the "dirty" flag which is applied to the tab title when the inner component is a DataStore with unsaved changes... A red asterisk is appended, and now with this change, the asterisk is wrapped to a new line which shifts everything and screws the whole interface up...

The easist way to test is simply to run rdbic.pl, go to a grid, enable cell editing, and make a change