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

Activity Changelog UI #909

Merged
merged 27 commits into from
Oct 13, 2023
Merged

Activity Changelog UI #909

merged 27 commits into from
Oct 13, 2023

Conversation

jeffpamer
Copy link
Contributor

This adds a first-pass UI for the activity directive changelog. The 10 most recent modifications to an activity directive are stored in a rolling list in the database. Clicking the changelog in the activity directive form header allows viewing a list of changelog entries with diffs displayed (when possible) between each revision. From there the user can either directly restore a revision, or preview the differences between that revision and the current one and decide whether to restore from there.

2023-09-28 14 53 21

There are some edges cases and strange scenarios we may likely need to iterate on from here. For instance:

  • I found some scenarios where I couldn't determine any changes between two revisions. Such as when creating a new preset from the activity's current parameters. This causes an entry to be written to the changelog, but no parameters change.
  • At the moment it doesn't seem like we have a way of differentiating multiple changes occurring as a result of using the API, or selecting a preset, etc. We may need to look into storing preset selection as one of the changes if we want to call that out specifically in the changelog.

@jeffpamer jeffpamer requested a review from a team as a code owner September 28, 2023 22:00
@jeffpamer jeffpamer linked an issue Sep 28, 2023 that may be closed by this pull request
@jeffpamer jeffpamer added the feature New feature or request label Sep 28, 2023
@AaronPlave
Copy link
Contributor

AaronPlave commented Oct 2, 2023

I found some scenarios where I couldn't determine any changes between two revisions. Such as when creating a new preset from the activity's current parameters. This causes an entry to be written to the changelog, but no parameters change.

Is this change revertible? And if not should it even be stored in the changelog?

@jeffpamer
Copy link
Contributor Author

Really appreciate your thorough review here @AaronPlave. I'll try to push up some changes for the more immediately actionable items shortly, but I'm unfortunately quite time restricted on how much time I can spend on Aerie this week. We might need to have a discussion about whether these pain points are blockers or can be iterated on later?

@AaronPlave
Copy link
Contributor

Really appreciate your thorough review here @AaronPlave. I'll try to push up some changes for the more immediately actionable items shortly, but I'm unfortunately quite time restricted on how much time I can spend on Aerie this week. We might need to have a discussion about whether these pain points are blockers or can be iterated on later?

Yeah we should tag up about what tweaks, if any, are needed to get this first version out.

@duranb
Copy link
Collaborator

duranb commented Oct 3, 2023

I found some scenarios where I couldn't determine any changes between two revisions. Such as when creating a new preset from the activity's current parameters. This causes an entry to be written to the changelog, but no parameters change.

Is this change revertible? And if not should it even be stored in the changelog?

I don't think that the creation of the preset should be revertible since it's not necessarily plan specific. You're seeing an entry in the changelog probably because upon creation, the UI also sends a query to assign after successfully creating. I think that maybe the assignment should at least be revertible if that data is tracked.

Copy link
Collaborator

@duranb duranb left a comment

Choose a reason for hiding this comment

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

I'm seeing a small styling issue with the Restore/Preview buttons being stacked for just the "Earliest" revision. The other revision buttons are 👌🏻
Screenshot 2023-10-03 at 3 05 23 PM

@duranb
Copy link
Collaborator

duranb commented Oct 3, 2023

Another suggestion for a different PR is maybe adding some loading state after clicking "Restore". In my plan that has 180 directives, I'm noticing that the directive's value that I restored doesn't get set until a second later after clicking "Restore". For that second I thought that I didn't click the right button.

@jeffpamer jeffpamer force-pushed the feature/activity-changelog branch from 0564688 to 0865121 Compare October 11, 2023 22:32
@jeffpamer jeffpamer force-pushed the feature/activity-changelog branch from 44bca18 to e8dbad3 Compare October 12, 2023 22:47
@jeffpamer jeffpamer temporarily deployed to test-workflow October 12, 2023 22:47 — with GitHub Actions Inactive
@jeffpamer
Copy link
Contributor Author

Pushed up a couple more changes to more generically handle diffing of objects (so we're recursively comparing them by value), so that we can display a nicer diff of changes nested in more complex parameter types. And also added tooltips for text labels that may be potentially cutoff by overflow.

image

@jeffpamer jeffpamer requested a review from duranb October 12, 2023 22:49
Copy link
Contributor

@AaronPlave AaronPlave left a comment

Choose a reason for hiding this comment

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

Looks great, I'm sure we'll have some feedback on it that will help us figure out the next iteration.

duranb
duranb previously requested changes Oct 13, 2023
src/utilities/permissions.ts Outdated Show resolved Hide resolved
@jeffpamer jeffpamer temporarily deployed to test-workflow October 13, 2023 20:00 — with GitHub Actions Inactive
@jeffpamer
Copy link
Contributor Author

Updated the auto-close logic to look specifically for a changing selected activity ID, so we don't hit that side effect where and update to the current activity also closes the changelog. I also updated the permissions check to consider plan ownership/collaborator.

@jeffpamer jeffpamer requested a review from duranb October 13, 2023 20:02
@jeffpamer jeffpamer dismissed duranb’s stale review October 13, 2023 20:03

Resolved as directed. Dismissing in case we want to merge today.

@jeffpamer jeffpamer merged commit a29bf31 into develop Oct 13, 2023
4 checks passed
@jeffpamer jeffpamer deleted the feature/activity-changelog branch October 13, 2023 22:44
JosephVolosin pushed a commit that referenced this pull request Aug 20, 2024
* Rough first pass at fetching changelog and displaying results per activity

* Basic working UI for change log, no restore or preview

* Account for anchor differences

* small formatting fixes and type corrections

* Catch scenarios with no changes, e.g. creating a preset

* remove unused data, format durations

* move changelog button into activity name header

* wire up effect for restoring from changelog

* Close the changelog if the selected activity changes

* use new changelog icon

* Basic working revision preview

* Add header and 'restore' action to revision preview

* more efficient effective arguments construction

* add Last Modified By to activity directive form

* Add permission handling

* fix linter errors

* drive anchor offset detection from props instead of activity object

* Fix tests. Add basic handling of array/struct types

* Fix date formatting, username display, and padding

* Display Start Time in DOY format

* re-run validations with preview arguments if supplied

* use revision when getting effective arguments, use current name of activity in changelog header

* constrain width to always have enough room for restore/preview buttons

* add more generic method for deep diffing objects

* add tooltip for overflowed values

* hook changelog auto-closing to a change in selected ID

* Update restore permissions check to account for plan ownership
JosephVolosin pushed a commit that referenced this pull request Oct 21, 2024
* Rough first pass at fetching changelog and displaying results per activity

* Basic working UI for change log, no restore or preview

* Account for anchor differences

* small formatting fixes and type corrections

* Catch scenarios with no changes, e.g. creating a preset

* remove unused data, format durations

* move changelog button into activity name header

* wire up effect for restoring from changelog

* Close the changelog if the selected activity changes

* use new changelog icon

* Basic working revision preview

* Add header and 'restore' action to revision preview

* more efficient effective arguments construction

* add Last Modified By to activity directive form

* Add permission handling

* fix linter errors

* drive anchor offset detection from props instead of activity object

* Fix tests. Add basic handling of array/struct types

* Fix date formatting, username display, and padding

* Display Start Time in DOY format

* re-run validations with preview arguments if supplied

* use revision when getting effective arguments, use current name of activity in changelog header

* constrain width to always have enough room for restore/preview buttons

* add more generic method for deep diffing objects

* add tooltip for overflowed values

* hook changelog auto-closing to a change in selected ID

* Update restore permissions check to account for plan ownership
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement first cut of activity change log in UI
4 participants