-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Quest: Document Solutions to "Titlebar Problem" #14430
Comments
Ugh, yes, chrome dev tools. Added that to the list. |
To my knowledge this problem is unsolvable in Chrome dev tools, which is a place where lots of folks spend quite a bit of their time.
to be precise, "even though those names have been designed in such a way as to have extensive repetition". |
For the JetBrains family of IDEs make sure to uncheck the "Small labels in editor tabs" setting under This will add the parent directory to the tab label (as soon as there is ambiguity): Tested with PHPStorm 2016, but should probably apply to the whole familiy of IDEs (WebStorm, IntelliJ, RubyMine etc.) |
Whereas most of these techniques do solve the basic problem, it remains the case that substantial title bar real estate is being wasted by the meaningless and semantically vacuous "component" part of the title. |
@ef4 For Atom you've noted, "No configuration required" . But I'm using Atom 1.10.2 and I do not see this behavior. Do you have an atom package installed? |
Addressed by @simonihmig. |
@rtm |
@workmanw I was the one that added Atom. I just tried it out on a clean environment and I see the same disambiguating behaviour. Reach me in #topic-editors. |
@pichfl thank you for the report, I didn't notice it and added my own screenshot. glad to see confirmation :) |
While there a few existing vim plugins to modify the way tabs are displayed, I didn't see any that could easily be configured to match the examples from the other editors here but I also didn't look very deeply into them so it does probably exist 😛 . Anyway, it's straightforward to modify your tabline settings in vim to get something nice like the others here so I threw together a plugin that does it for you that people can use (or copy code from and make into their own special snowflake tabs). |
Just a note to this being solved in Atom. Here's how it looks with Seti-UI, one of the most popular Atom themes. This is with 3 files open, fullscreen on a 27" monitor. |
I'm not sure I would consider it solved in an editor that only did it when there is a name conflict among the files open. I think it would be nice to be able to always show the parent directory. |
Prior art on how to address this issue: smart-tab-name custom-title tab-foldername-index |
@workmanw @dfreeman @willmanduffy et al: I've been using ember-tabs in Atom for a while now, and it solves 100% of my problems. The "No configuration required" behavior screenshotted above only kicks in when you have multiple files with the same name open, and truncates the part you care about, whereas ember-tabs leads with the component root: It also has a handy keyboard shortcut to swap between template.hbs & component.js within a folder or subfolder. At this point Chrome devtools is my only pain point, and it's unfortunately a big one. |
There's also a plugin for Jetbrains IDEs called Tabdir, https://plugins.jetbrains.com/idea/plugin/5045-tabdir , which lets you customize tabs even more (show more folders in a title, get rid of the component.js so that you can distinguish just by folder + Appearance -> File colors etc.) |
This may be slightly off-topic, but did anyone consider the impact of naming JS and hbs files not only on the title bar but search results? Say I have a Wit the above in mind would paths like these be better?
Where the path provides "context" kind of like the idea in contexts in Phoenix Framework, though those relate to models, not UI components. I think the above naming could help both the title issue, and search/browse issue. I would love to hear your comments |
Hey @ef4 ! It looks like we were able to knock out most of the editors on the list. Do you think maybe we could close this out (and re-open editor-specific issues if others still need support)? |
Here is what I use for VIM: https://github.com/sukima/vimrc/blob/master/_vimrc#L779-L833 " Custom 'tabline' {{{2
let g:ember_pod_types = {
\"component": "C",
\"template": "T",
\"controller": "CN",
\"route": "R",
\"service": "S",
\"model": "M"
\}
if exists("+showtabline")
function! TabNameFor(file)
let isTest = v:false
let name = fnamemodify(a:file, ':p:t')
if name == ''
return '[No Name]'
endif
let type = fnamemodify(a:file, ':p:t:r')
if type =~ "-test$"
let isTest = v:true
let type = substitute(type, "-test$", "", "")
endif
if !has_key(g:ember_pod_types, type)
return name
endif
let name = fnamemodify(a:file, ':p:h:t')
let typeCode = g:ember_pod_types[type]
if isTest
let typeCode .= '-T'
endif
return typeCode . ':' . name
endfunction
function! MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= '[' . i . ']'
let s .= '%*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let s .= TabNameFor(bufname(buflist[winnr - 1]))
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set showtabline=1
set tabline=%!MyTabLine()
endif |
RFC 143 included discussion around properly configuring text editors so that it's easy for developers to distinguish filenames within a typical Ember app, even though those names necessarily have some repetition. The canonical example is that files like these:
should be readily distinguishable despite sharing a common ending.
This quest issue exists so that people can chime in on what (if anything) is required to make all the popular editors do this nicely.
Editors
Please suggest others as long as you actually use them to work on Ember apps.
Solutions
Atom (@locks)
No configuration required:
Brackets (@locks)
No configuration required:
Emacs
The out-of-the-box behavior since Emacs 24.4 for the two example files is that they appear as
component.js<date-picker>
andcomponent.js<list-paginator>
. So no configuration is required.To see all the options for customizing this behavior, see
M-x customize-group uniquify
.Visual Studio Code (taken from @tomdale comment on RFC 143)
No configuration required:
## JetBrains family (PHPStorm, WebStorm, IntelliJ, RubyMine)
For the JetBrains family of IDEs make sure to uncheck the "Small labels in editor tabs" setting under
Preferences > Appearance & Behavior > Appearance
:This will add the parent directory to the tab label (as soon as there is ambiguity):
Tested with PHPStorm 2016, but should probably apply to the whole familiy of IDEs (WebStorm, IntelliJ, RubyMine etc.)
Sublime Text (@locks)
No configuration required:
Chocolat (@locks)
No configuration required:
The text was updated successfully, but these errors were encountered: