Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
UI improvements #187
UI improvements #187
Changes from all commits
1a44d69
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a scope on
Run
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, the way the query is right now you need the last run as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just use a lambda, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't explain my main point. My worry is that it is weird for
Run
to define a scope that is purely focused on a UI decision of showing the last Run separately from the others.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a needless query that doesn't make much sense (since id can't be NULL, the second condition is always true) when there's no run:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return early if there's no last_run`? Or wrap the query and pagy calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we could inline the partials, it would not be too long and be less jumping around and fewer 1-line files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree if those partials were used only in here, but they must be available in other places as well. I think having smaller partials that work as reusable view components are easier to maintain, which compensates for the indirection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that applies to inlining inside the runs/info partial, the status partials are only called from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
info
partial calls the status-specific partial with interpolation for their path. Are you suggesting me to inline all of them over there? Please feel free to simplify views later as you see fit, for now I'm not really following.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most importantly, the
...
into…
😄 then maybe:Sorry I can't add a comment to the other thread, but I disagree with not talking about jobs and workers. We should probably mention it in the README as well, but I feel like when users have installed and written a task nothing could lead them to know that the task may be interrupted, so it would really be confusing. Especially if there's some queuing going on and they don't know why they're looking at that sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not show "interrupted" as a status in that case. We are striving towards abstracting jobs away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a n+1.
Also it's ignoring runs of tasks that have been deleted. Right now we're able to show them, even if the tasks#show page is broken.
I can tackle this later, but I feel like loading all the active Runs, and showing them first would be valuable in any case (in this PR if you have a few tasks, you may not see one running that's below the fold).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in the index page. This refresh intends to display Task information in that page, not Runs. We can discuss how we could show orphan Runs later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index page lists all the tasks, showing their last run status here in the title, and their last run info below in the card. So it does display Run information, I'm not sure I follow your comment here?
If we only wanted tasks here I wouldn't mind just showing the task, and keeping the active tasks and the completed tasks separate on the index page.
But we merged the concepts here, and I think it's awesome, but it's a bit limited by not surfacing the currently running tasks, they're just lost in the list.
I almost feel like we should show:
And yes the runs for deleted tasks are out of scope, I just thought we could tackle the n+1 and surfacing the running tasks before shipping this. But it's fine I can look at it when doing the deleted tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about the order in which we rank the Tasks. We can improve it further in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could also extract this into a helper to be reused between this and
show.html.erb
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now. I need the
run
instance to be in the view itself for later usage in therender
below. We can improve it later on.