Add support for icon-only tasks (what browsers call pinned tabs)
Needs ReviewPublic

Authored by Fuchs on Apr 22 2018, 10:19 PM.

Details

Reviewers
hein
Summary

This adds backend support for pinned tasks, which will only show an icon in the regular task manager (no impact on icons-only).

BUG: 391572

Diff Detail

Repository
R120 Plasma Workspace
Branch
taskmanager-pin (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Fuchs created this revision.Apr 22 2018, 10:19 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 22 2018, 10:19 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Fuchs requested review of this revision.Apr 22 2018, 10:19 PM

Also needs https://phabricator.kde.org/D12463

What it does: adds a new menu entry for the non-icon-only task manager which allows to set an application "icon only", so it will always be displayed without label (like a launcher) even if in running state.
Both sorting and grouping are not affected and behave the same as they would for unpinned.

currently looks like this:

Known issue: if there are multiple windows of the same application, unpinning will leave the other instances without label. Didn't find out what causes this yet, would be happy for input. Newly created windows of the same type are not affected.

Fuchs edited the summary of this revision. (Show Details)Apr 22 2018, 10:35 PM
Fuchs added a comment.EditedApr 23 2018, 8:25 PM

On the existing bug: it's related to the TODO at line 1513, changing that to

for (int i = 0; i < d->concatProxyModel->rowCount(); ++i) {
    const QModelIndex &itIndex = d->concatProxyModel->index(i, 0);

    // Launchers can't be pinned / unpinned
    if (itIndex.data(AbstractTasksModel::IsLauncher).toBool()) {
        continue;
    }
    
    dataChanged(itIndex, itIndex, QVector<int>{AbstractTasksModel::IsPinned});
    
}

fixes the bug, but of course that goes through all items and not only the needed ones, so it's bad performance-wise.

Oddly enough, changing the second part to

// Check all windows if they match, then update the isPinned for them too. 
// This is needed so if you pin / unpin an app that has multiple instances open, all are updated.
if (appsMatch(index, itIndex)) {
    dataChanged(itIndex, itIndex, QVector<int>{AbstractTasksModel::IsPinned});
}

matched only parts of the same window, so if I e.g. had 3 konsole instances open, it affected 2/3 sometimes. Might need a mapToSource I guess?

No idea what I am doing wrong here, hopefully @hein will know what list I best iterate over and how to best compare them, so it's not only fixed, but fixed without performance impact.

mart added a subscriber: mart.Apr 24 2018, 1:38 PM

I like the idea a lot,
tough i am not sure i like the implementation: right now is kindof hortogonal to pinned tasks and gets confusing as it has a partial, but not complete overlap.
I think this should just be the behavior for pinned tasks, in order to map perfectly to the workflow of browser pinned tasks (and have only one option, pin task, instead of pin task and remove text)

Fuchs added a comment.EditedApr 24 2018, 1:43 PM
In D12462#252982, @mart wrote:

I like the idea a lot,
tough i am not sure i like the implementation: right now is kindof hortogonal to pinned tasks and gets confusing as it has a partial, but not complete overlap.
I think this should just be the behavior for pinned tasks, in order to map perfectly to the workflow of browser pinned tasks (and have only one option, pin task, instead of pin task and remove text)

Pinned tasks, right now, are bound to activities iff the amount of activities is >= 2. So these do different things (arguably current "pin" is badly named):

  1. The current "pin" is based on activities, whilst my "always show only icon" is completely unrelated to activities. There are proper usecases for the former.
  2. My "always show only icon" is only available in regular task manager, whilst current "pin" is obviously available in icon only task manager, as it is a seperate use case ("launcher")

So they can't be fusioned easily.

I agree that a launcher (currently called pin) looks, when not running, almost the same as "always show only icon". The difference is the small bar on top (bottom if your panel is top), which correctly makes it look like an open window (which it is) and it's state (active, demands attention., minimized, whatnot)

I think both have valid use cases and potentially both are needed, but maybe they could both be polished a bit so they are aptly named and look and act distinguishable.

mart added a comment.May 2 2018, 9:56 AM
In D12462#252982, @mart wrote:

I like the idea a lot,
tough i am not sure i like the implementation: right now is kindof hortogonal to pinned tasks and gets confusing as it has a partial, but not complete overlap.
I think this should just be the behavior for pinned tasks, in order to map perfectly to the workflow of browser pinned tasks (and have only one option, pin task, instead of pin task and remove text)

Pinned tasks, right now, are bound to activities iff the amount of activities is >= 2. So these do different things (arguably current "pin" is badly named):

a task still, can be pinned to all activities, so still seems like an useless complication to me.

to me pinning should mean:

  • i say what are the most important tasks to me (regardless if it's for one activity or for all activities)
  • i want them always there, no matter whether running or not
  • they stay always exactly in the same place (muscle memory) therefore can't have text and never move when they are started

to achieve that, i should do one action, not 2, it looks like bad UI for me otherwise.

Fuchs added a comment.May 2 2018, 10:46 AM
In D12462#257021, @mart wrote:
In D12462#252982, @mart wrote:

I like the idea a lot,
tough i am not sure i like the implementation: right now is kindof hortogonal to pinned tasks and gets confusing as it has a partial, but not complete overlap.
I think this should just be the behavior for pinned tasks, in order to map perfectly to the workflow of browser pinned tasks (and have only one option, pin task, instead of pin task and remove text)

Pinned tasks, right now, are bound to activities iff the amount of activities is >= 2. So these do different things (arguably current "pin" is badly named):

a task still, can be pinned to all activities, so still seems like an useless complication to me.

to me pinning should mean:

  • i say what are the most important tasks to me (regardless if it's for one activity or for all activities)
  • i want them always there, no matter whether running or not
  • they stay always exactly in the same place (muscle memory) therefore can't have text and never move when they are started

    to achieve that, i should do one action, not 2, it looks like bad UI for me otherwise.

Personally I think that "don't show label" and "always show entry" are two entirely different use cases, especially as "don't show label" simply does not exist in icons-only taskmanager, whilst "always show entry" does. Calling either of them pinned is, imho, a bad idea.
Whether it should or should not be bound to activities is not something I can comment on, since I simply don't use activities.

Muscle memory is why I use icons only task manager, the "do not show label" thing is more for users who use the "regular" task manager, and I think for a majority of them it's indeed two different use cases.
Maybe one could have something a bit more smart, similar to sorting, where you can decide whether you want to manually tell which labels not to show, or all matching a specific rule, e.g. "has a launcher".

to me pinning should mean:

  • i say what are the most important tasks to me (regardless if it's for one activity or for all activities)
  • i want them always there, no matter whether running or not
  • they stay always exactly in the same place (muscle memory) therefore can't have text and never move when they are started

    to achieve that, i should do one action, not 2, it looks like bad UI for me otherwise.

I would rather not have all the "icon only tasks" as starters ("always show entry"), if they are not running. To me a "icon only task" is something I would like to apply on tasks, that only have (normally) one instance running, so there is no problem with confusing them. They don't have to be the most important apps to me at all. Depending on your workflow these might include chat apps, ide's, multimedia editors like krita, kdenlive, kontact ... .

eg I only start Krita every couple of weeks, but I never start it twice so I would not need a task bar entry with text. But I don't need a starter for it either, since I don't start it very often. To me starters are something unrelated. (And they are pretty broken, in my option, when used with multiple workspaces and you only show entries from the current workspace in the taskbar, but that's probably besides point here)

mart added a comment.May 2 2018, 12:25 PM

anyways, that's just my personal use case (that has a lot of keep it simple)
final decision is Eike's