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

Tasks: UI Polish #10132

Closed
6 of 7 tasks
maxbrunsfeld opened this issue Apr 3, 2024 · 4 comments
Closed
6 of 7 tasks

Tasks: UI Polish #10132

maxbrunsfeld opened this issue Apr 3, 2024 · 4 comments
Assignees
Labels
enhancement [core label] tasks tracking Issue that tracks a group of related issues workspace Feedback for workspace management, layout, interactions, etc

Comments

@maxbrunsfeld
Copy link
Collaborator

maxbrunsfeld commented Apr 3, 2024

Check for existing issues

  • Completed

Describe the feature

Some minor changes that we came up with to make the Tasks feature more polished and discoverable:

  • @osiewicz adds task discoverability improvements
  • bug: with default settings, after running a task, nothing is focused.
    • By default, focus should not change - restore the previous focus on closing the task modal
  • Add a "play" icon in the status bar that, when clicked, opens the task modal
    • This icon could have a status indicator
      • red if any open task tab failed
      • else, yellow if any open task tab is still running
      • else, green if there tasks tabs open, and they have all succeeded
      • else, no indicator if there are no open task tabs
  • change the placeholder text of the task modal
    • lets de-emphasize "task name as prompt" / oneshot use case
    • Maybe just "Run a task..."
  • Remove 'language extension' secondary text, instead display an icon indicating the language extension
    • new trait method on the TaskSource
  • Task tabs for "run current function" should just say: "Rust: test_foo_bar", to make it easy to scan which test is running
    • use this same name in the task modal
    • same thing for "Test current crate", "cargo check current crate"

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@maxbrunsfeld maxbrunsfeld added enhancement [core label] triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 3, 2024
@jansol
Copy link
Contributor

jansol commented Apr 3, 2024

Related: #9633

@Moshyfawn Moshyfawn added workspace Feedback for workspace management, layout, interactions, etc tracking Issue that tracks a group of related issues tasks and removed triage Maintainer needs to classify the issue labels Apr 4, 2024
osiewicz added a commit that referenced this issue Apr 4, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label Apr 4, 2024
@osiewicz
Copy link
Contributor

osiewicz commented Apr 8, 2024

For first point (a focus bug), the current behavior is correct; by default, we focus terminal & switch to a newly spawned task. Users have an option to not focus the terminal at all (though this also doesn't expand the panel if it's collapsed at the time of task spawning).
There was a bug with status bar items that showed up when spawning new terminals (even when they were not task terminals); I've fixed that in #10275. We may want to change the default/add more variants of RevealStrategy to make the behavior customizable.

SomeoneToIgnore added a commit that referenced this issue Apr 9, 2024
Part of #10132 extracted out
of a bigger PR that refactors tasks and shows labels that look more like
commands (ergo needs better readable package names)

Release Notes:

- N/A
SomeoneToIgnore added a commit that referenced this issue Apr 10, 2024
New list (used tasks are above the separator line, sorted by the usage
recency), then all language tasks, then project-local and global tasks
are listed.
Note that there are two test tasks (for `test_name_1` and `test_name_2`
functions) that are created from the same task template:
<img width="563" alt="Screenshot 2024-04-10 at 01 00 46"
src="https://github.com/zed-industries/zed/assets/2690773/7455a82f-2af2-47bf-99bd-d9c5a36e64ab">

Tasks are deduplicated by labels, with the used tasks left in case of
the conflict with the new tasks from the template:
<img width="555" alt="Screenshot 2024-04-10 at 01 01 06"
src="https://github.com/zed-industries/zed/assets/2690773/8f5a249e-abec-46ef-a991-08c6d0348648">

Regular recent tasks can be now removed too:
<img width="565" alt="Screenshot 2024-04-10 at 01 00 55"
src="https://github.com/zed-industries/zed/assets/2690773/0976b8fe-b5d7-4d2a-953d-1d8b1f216192">

When the caret is in the place where no function symbol could be
retrieved, no cargo tests for function are listed in tasks:
<img width="556" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/df30feba-fe27-4645-8be9-02afc70f02da">


Part of #10132
Reworks the task code to simplify it and enable proper task labels.

* removes `trait Task`, renames `Definition` into `TaskTemplate` and use
that instead of `Arc<dyn Task>` everywhere
* implement more generic `TaskId` generation that depends on the
`TaskContext` and `TaskTemplate`
* remove `TaskId` out of the template and only create it after
"resolving" the template into the `ResolvedTask`: this way, task
templates, task state (`TaskContext`) and task "result" (resolved state)
are clearly separated and are not mixed
* implement the logic for filtering out non-related language tasks and
tasks that have non-resolved Zed task variables
* rework Zed template-vs-resolved-task display in modal: now all reruns
and recently used tasks are resolved tasks with "fixed" context (unless
configured otherwise in the task json) that are always shown, and Zed
can add on top tasks with different context that are derived from the
same template as the used, resolved tasks
* sort the tasks list better, showing more specific and least recently
used tasks higher
* shows a separator between used and unused tasks, allow removing the
used tasks same as the oneshot ones
* remote the Oneshot task source as redundant: all oneshot tasks are now
stored in the inventory's history
* when reusing the tasks as query in the modal, paste the expanded task
label now, show trimmed resolved label in the modal
* adjusts Rust and Elixir task labels to be more descriptive and closer
to bash scripts

Release Notes:

- Improved task modal ordering, run and deletion capabilities
@JustFrederik
Copy link

Indicators right next to the code would be great
Screenshot 2024-04-16 at 17 23 05
Screenshot 2024-04-16 at 17 22 56
Screenshot 2024-04-16 at 17 22 22

@SomeoneToIgnore
Copy link
Contributor

The remaining open task is being done in #11195 so closing this optimistically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] tasks tracking Issue that tracks a group of related issues workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
Development

No branches or pull requests

7 participants