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

Auto-flatten single-child directories in GScan sidebar #1416

Merged
merged 17 commits into from
Oct 26, 2023

Conversation

MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Aug 2, 2023

Closes #865
Closes #1417
Partially addresses #952

Supersedes #1175 & #1406

This is @AaronDCole's #1175 squash rebased onto master plus some tidying up and optimisation and fixes for a couple of small issues.

Update:

image

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Tests are included
  • CHANGES.md entry included if this is a change that can affect users
  • No docs
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added the UX/UI User experience and interface improvements label Aug 2, 2023
@MetRonnie MetRonnie added this to the 2.1.0 milestone Aug 2, 2023
@MetRonnie MetRonnie changed the title Auto-collapsing GScan Auto-collapsing GScan nodes Aug 2, 2023
@wxtim
Copy link
Member

wxtim commented Aug 3, 2023

Review

Initial testing looks good

image

Is it OK (probably tangential) that the task state LEDs dissapear under the edge of the GScan if the sidebar isn't wide enough? The do reappear if you resize the bar. I have not yet checked this on master, but will do so once I've finished this review and am happy to put the branch I'm reviewing away.

Possible Bug

If I change

# global.cylc
[install]
  max depth = 8

Workflows installed at a depth > 4 don't show at all!

Wheras on master:
image

CHANGES.md Show resolved Hide resolved
@MetRonnie
Copy link
Member Author

If I change

# global.cylc
[install]
  max depth = 8

Workflows installed at a depth > 4 don't show at all!

They do for me

@MetRonnie MetRonnie marked this pull request as draft August 10, 2023 15:18
@oliver-sanders oliver-sanders modified the milestones: 2.1.0, 2.2.0 Aug 15, 2023
@MetRonnie MetRonnie changed the title Auto-collapsing GScan nodes Auto-flatten single-child directories in GScan sidebar Oct 9, 2023
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good (was a fun diff to unravel).

Workflow collapsing looks good, haven't tested deeply yet, will give that a go shortly.

I did spot one issue where the workflow icons stopped being clickable after state change.

Also, another one, but I'm not sure if it's related to this PR. The counter doesn't make a whole lot of sense to me:

Screenshot from 2023-10-23 13-23-11

This is made more pronounced by the collated totals for a workflow installation hierarchy as the counters don't appear to be summed?

A possible enhancement to the state total summing which would be really handy if it's easy to squeeze into this PR. Keep the collapsed summary open when the node is expanded. I.E. always show the aggregate state totals.

src/components/cylc/tree/GScanTreeItem.vue Outdated Show resolved Hide resolved
src/components/cylc/tree/GScanTreeItem.vue Outdated Show resolved Hide resolved
src/components/cylc/tree/GScanTreeItem.vue Outdated Show resolved Hide resolved
:startTime="(latestJob(node) || {}).startedTime"
<slot v-bind="{ isExpanded }">
<!-- the node value -->
<!-- TODO: revisit these node.type values that can be replaced by constants later (and in other components too). -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what this TODO means?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it means

-v-if="node.type === 'cycle'"
+v-if="node.type === CYCLE"

Comment on lines +47 to +60
<div
:class="nodeDataClass"
:style="nodeDataStyle"
>
<template v-if="node.type === 'cycle'">
<!-- NOTE: cycle point nodes don't have any data associated with them
at present so we must use the root family node for the task icon.
We don't use this for the v-cylc-object as that would set the node
type to family. -->
<Task
v-cylc-object="node"
v-if="node.familyTree?.length"
:key="node.id"
:task="node.familyTree[0].node"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the TreeView specific code go into a TreeViewTreeItem component similar to how the GScanView specific code when into GScanTreeItem component?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it but decided to hold off. Performance-wise, I don't think this is too much of a problem because there is not likely to be too many workflows in GScan compared to cycle points/families/tasks in the Tree view which could be hundreds. (Having said that, we did see that one case of run249!)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it probably should go there, but there's no pressure to do so ATM?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want me to open an issue for it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do, I was mostly just trying to understand the motive for the changes.

src/components/cylc/tree/TreeItem.vue Show resolved Hide resolved
src/components/cylc/tree/TreeItem.vue Show resolved Hide resolved
@@ -16,7 +16,7 @@
*/

/** query used for the graphiql test */
const query = `query App {
const query = `query Workflow {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this works but when you run this query in the Cypress window you get the response from the field with the matching name at src/services/mock/json/index.cjs. (But you get an empty response if running the query in the normal browser 🤷‍♂️.) Because I changed App to be an array of workflows, the result of this query seems to be the last workflow in the array. But I didn't change Workflow so it still returns workflow one

@MetRonnie
Copy link
Member Author

The counter doesn't make a whole lot of sense to me:

Screenshot from 2023-10-23 13-23-11

It means 0 tasks currently in the submitted state. But lists tasks that were recently submitted.

@MetRonnie
Copy link
Member Author

MetRonnie commented Oct 24, 2023

Is it OK (probably tangential) that the task state LEDs dissapear under the edge of the GScan if the sidebar isn't wide enough? The do reappear if you resize the bar.

Fixed btw (in 4404fc0 I think)

@oliver-sanders
Copy link
Member

MetRonnie#6

@oliver-sanders
Copy link
Member

oliver-sanders commented Oct 24, 2023

Nice!

Screenshot from 2023-10-24 15-22-16

@MetRonnie
Copy link
Member Author

MetRonnie#6

I think this is the case you are talking about - a single-child workflow-part that is itself a child of a many-child workflow-part?

image

Fixed in 90c92dd

Binding `:class` on the component that the `v-cylc-object` directive is applied to interfered with adding the `c-interactive` class in the directive.
So I have changed it to a data attribute.
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Tried to break locally.
  • Read the code.

@wxtim wxtim merged commit 0a4450b into cylc:master Oct 26, 2023
8 checks passed
@MetRonnie MetRonnie deleted the gscan branch October 26, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX/UI User experience and interface improvements
Projects
None yet
4 participants