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

refactor/upcoming: [M3-8116] - Event Messages - Part 1 #10517

Merged
merged 49 commits into from
Jun 4, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented May 24, 2024

Description 📝

This PR is part 1 of several contributions to refactor the way we are rendering event messages to our users.

It does not currently affect production. It is behind a feature flag, and once merged meant to sit in develop for some time in order to catch potential formatting issues.

The goals behind the refactor are rather simple:

  • Deprecate the formatting & parsing of event messages in favor of composing & rendering JSX messages
  • Improve structure, consistency, typing, control and stability of Event Messages

Changes 🔄

  • Create new utils and JSX components to compose messages
    • Provide coverage and JSDocs
    • Include in Storybook as needed
    • Include future deprecation/deletion comments
  • Compose all existing messages and add missing ones
  • Implement rendering of new messages behind eventMessagesV2 feature flag
    • Event table (/events + /linodes/{linodeId}/activity)
    • Notification Center (popup)
  • Improve styling/layout according to approved UX guides
  • Update documentation

For more details about changes, see self review and screenshots

Target release date 🗓️

Preview 📷

Include a screenshot or screen recording of the change

💡 Use <video src="" /> tag when including recordings in table.

Before After
Events localhost 3000 (2) Events localhost
Screenshot 2024-05-31 at 10 16 17 Screenshot 2024-05-31 at 10 15 57
Events localhost 3000 (3) Events localhost 3000 (4)

How to test 🧪

Prerequisites

  • Turn on the eventMessagesV2 flag

Verification steps

Cloud Manager

  • Confirm formatting and displaying of messages in
    • Notification Center (events popup)
    • /events page
    • /linodes/{linodeId}/activity

Storybook

Docs

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

'vpc_update',
] as const;

export type EventAction = typeof EventActionValues[number];
Copy link
Contributor Author

@abailly-akamai abailly-akamai May 30, 2024

Choose a reason for hiding this comment

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

  • No change affecting the types (only some added from fetching the hosting Db for events
  • Exporting EventActionValues allows us to iterate over a list of values for our tests, ensuring we have a corresponding message for each action.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding some of the missing ones. I'd noticed firewall_apply recently was lacking an event message, and that'll be fixed here.

</Snackbar>
);
},
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding an example on how to fetch a single event for a snackbar

const link = getLinkForEvent(event.action, entity);

return link ? <Link to={link}>{entity.label}</Link> : renderDefault();
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of parsing and formatting event, we compose them with reusable components

display: 'inline',
fontSize: '0.75rem',
padding: '0.15rem 0.25rem',
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of parsing and formatting event, we compose them with reusable components

Copy link
Contributor Author

@abailly-akamai abailly-akamai May 30, 2024

Choose a reason for hiding this comment

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

replaced with the v2 version. This did not have much value as it was.

},
width: '60%',
width: 'calc(100% - 400px)',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

improves /event table row layout in both v1 and v2 (very slight changes)

<Hidden mdDown>
<StyledTableCell data-qa-events-time-header>
<StyledTableCell data-qa-events-time-header sx={{ width: 150 }}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementing approved events table UX changes

  • remove avatar from table
  • add a user column
  • improve responsive handling

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm all for removing the avatar. 🚀

User column looks great too, but I did notice that in mobile view, if there is no username, we get a by .

Screenshot 2024-05-31 at 4 13 12 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was not in use at all 🧹

</>
) : null
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New version contains approved UX changes

  • User name is not appended to message, and added next to the timestamp, separated by a pipe
  • Gravatar size is slightly decreased

Copy link
Contributor

Choose a reason for hiding this comment

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

The gravatar size of in-progress events is still a slightly larger size. (Can turn on the MSW to see this, rather than kick off an action that takes a while.)

Screenshot 2024-06-03 at 1 09 53 PM

@@ -235,7 +235,6 @@ const StyledNotificationItem = styled(Box, {
shouldForwardProp: omittedProps(['header']),
})<{ header: string }>(({ theme, ...props }) => ({
'& p': {
color: theme.textColors.headlineStatic,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing to make messages the same color as regular copy (not sure why it was overridden)

@abailly-akamai abailly-akamai changed the title refactor: [M3-8116] - Event Messages refactor: [M3-8116] - Event Messages - Part 1 May 30, 2024
abailly-akamai and others added 2 commits June 3, 2024 09:32
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@abailly-akamai
Copy link
Contributor Author

Thanks for all the suggestions and the thorough review, @mjac0bs! I know it's a lot to read through! Updated PR with all copy and type suggestions.

@abailly-akamai abailly-akamai requested a review from mjac0bs June 3, 2024 13:39
Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

This is such an awesome improvement! Thanks @abailly-akamai.

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Confirmed:

  • Updated Storybook stories load
  • Test coverage is added for the changes and tests pass
  • The edge case for no usernames with the | or "by " showing up was addressed

Suggested:

  • A lot of minor nits in event message factories. Some typos (that probably existed before this PR), the need for a couple periods, some places where we missed bolding and might have missed linking an entity.
  • The need to fix a contrast issue with pre code block styling in dark mode.
  • The need to shrink the gravatar size for in-progress events.

Pending the resolution of my 19 or so comments (😅 ), I'm approving this because I've been through all 71 files. Let me know if you want me to circle back to confirm any fixes that are implemented. Thanks, @abailly-akamai!

packages/manager/src/features/Events/factories/backup.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/factories/disk.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/EventMessage.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/EventRowV2.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/factories/volume.tsx Outdated Show resolved Hide resolved
</>
) : null
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The gravatar size of in-progress events is still a slightly larger size. (Can turn on the MSW to see this, rather than kick off an action that takes a while.)

Screenshot 2024-06-03 at 1 09 53 PM

packages/manager/src/features/Events/factories/volume.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/factories/lke.tsx Outdated Show resolved Hide resolved
docs/development-guide/15-api-events.md Outdated Show resolved Hide resolved
abailly-akamai and others added 7 commits June 3, 2024 17:08
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@abailly-akamai
Copy link
Contributor Author

Thanks @mjac0bs and @dwiley-akamai - all feedback addressed (either committed from your suggestion or committed myself). Feedback much appreciated!

@mjac0bs
Copy link
Contributor

mjac0bs commented Jun 3, 2024

@abailly-akamai There are some hidden comments that github collapsed (which I wish it wouldn't do), that I'm seeing neither marked as Outdated or Resolved. Did those get missed by accident?

Screenshot 2024-06-03 at 2 33 57 PM

@abailly-akamai
Copy link
Contributor Author

@mjac0bs oops! will certainly address those, thx for catching!

abailly-akamai and others added 6 commits June 3, 2024 20:07
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@abailly-akamai abailly-akamai merged commit 55c8101 into linode:develop Jun 4, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants