Skip to content
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

Provide a feature to group or manage sets of buffers (a.k.a. window titler) #1573

Closed
novoid opened this issue Jun 30, 2021 · 8 comments
Closed
Labels
feature Feature requests. good-first-issue Marks a good issue for first-time contributors.

Comments

@novoid
Copy link

novoid commented Jun 30, 2021

Hi, I am copying some thoughts from this reddit discussion about "Window Titler" (FF add-on) to here.

The underlying requirement I address here is that my current Firefox has 14 Windows with 96 tabs. It would be too cumbersome to switch between all those buffers without some kind of grouping by task/purpose/topic/whatever.

How I'm currently handling this issue in Firefox

By giving each FF window a name via the small FF add-on "Window Titler", each window gets an optional prefix like "[News] " which is clearly visible in my task bar. Instead of "What's preventing ..." of this page, I get a window title like "[News] What's pre...". The prefix stays independent of the selected tab within the window.

That way, I separate "sets of tabs" according to their shared relationship usually for a task. It is noteworthy that I use this all the time with very similar web pages. For business use, I may have multiple windows for different tasks that all contain tabs of our Confluence system. Therefore, buffer management by domain does not solve the issue I'm addressing here because I could not differ between Confluence pages related to task X and a different task Y that both require Confluence pages.

Example: a FF window gets the title "ISO" and it contains all tabs I'm working with for ISO compliance. Another window gets "ProjX" which contains all tabs for a specific project. Both do contain Confluence pages of the same space.

There are many different solutions to handle large numbers of tabs. TreeTabs seems to be a popular one.

How Nyxt could address the issue of managing many buffers

With Nyxt, it would require the user to remember (and know) which buffer is associated to which task. I would get 96 buffers that are on the same level, without any grouping. From this perspective, "Window Titler" offers a similar functionality than projectile: jumping between things within the same "project".

Nyxt should offer at least some kind of answer to this requirement. Maybe built-in, maybe as an add-on.

One idea (of many possible): adding an optional prefix to a buffer which gets inherited to pages that gets opened from here. E.g., M-SPC buffer-prefix-set Nyxt RET on a buffer whose Title was "New Issue - atlas-engineer/nyxt" results in a new Title "Nyxt - New Issue - atlas-engineer/nyxt". When I follow any URL on this page or open up a new buffer via make-buffer, this prefix is inherited as long as I don't remove the prefix or choose a different one.
Potential customization: prefix and postfix for the prefix above (maybe called label instead) so that you may get "[Nyxt] - $originaltitle" instead with prefix = "[" and postfix = "] - ". (Sorry, I've now mixed up terms with prefix and label but I guess you get my idea)

@Ambrevar
Copy link
Member

Thanks for the great description :)

Note that unlike most browser, Nyxt buffers (tabs) don't "belong" to windows. A buffer can be switched to from any window. It'd would be interesting to add an option to simulate the 1-1 mapping between buffer and windows that other browsers allow.
See #503.

About tree tabs: I'm currently working on a buffer tree display, stay tuned.
See #854 and #565.

Finally, about the window naming: it's trivial to implement, let's just do it then!

@Ambrevar Ambrevar changed the title Provide a feature to group or manage sets of buffers Provide a feature to group or manage sets of buffers (a.k.a. window titler) Jun 30, 2021
@Ambrevar Ambrevar added feature Feature requests. good-first-issue Marks a good issue for first-time contributors. labels Jun 30, 2021
@arjaz
Copy link

arjaz commented Jul 5, 2021

You can have something like that for that purpose:

(define-command-global tag-current-buffer ()
  "Add a tag to the current web-buffer name."
  (let ((buf (current-buffer)))
    (when (equal (mode-name buf) 'web-buffer)
      (let* ((tag-str (first (prompt :prompt "Tag"
                                     :sources (make-instance
                                               'prompter:word-source))))
             (tag (str:concat "[" tag-str "]"))
             (old-title (title buf)))
        (unless (str:containsp tag old-title)
          (setf (title buf) (str:concat tag " : " old-title)))))))

@Ambrevar
Copy link
Member

Ambrevar commented Jul 5, 2021

@arjaz I believe the tags will be overwritten on the next page load, won't they?

@arjaz
Copy link

arjaz commented Jul 5, 2021

@Ambrevar They will. That's a small solution that I've been using for a bit, thought it might be relevant here

@Ambrevar
Copy link
Member

Ambrevar commented Jul 5, 2021

See #1592 for a proper way to customize the window title.

@Ambrevar Ambrevar mentioned this issue Jul 5, 2021
@Ambrevar
Copy link
Member

Ambrevar commented Jul 7, 2021

The titler is now merged.
The buffer tree is coming soon!
We also now have panels which allows for a "vertical tabs" kind of display.

@novoid
Copy link
Author

novoid commented Jul 7, 2021

@arjaz I believe the tags will be overwritten on the next page load, won't they?

And as far as I understand the code snippet, there is also no inheritance. Therefore, each single buffer needs to be tagged separately. I guess inheritance is no simple change.

@aadcg
Copy link
Member

aadcg commented Oct 22, 2023

Nothing actionable to extract from this request.

@aadcg aadcg closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests. good-first-issue Marks a good issue for first-time contributors.
Development

No branches or pull requests

4 participants