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

feat: change CR strategy title and name behaviour #4004

Merged
merged 4 commits into from
Jun 19, 2023
Merged

Conversation

sjaanus
Copy link
Contributor

@sjaanus sjaanus commented Jun 19, 2023

image

@vercel
Copy link

vercel bot commented Jun 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2023 9:47am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 19, 2023 9:47am

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

Minor comments

)}
show={
<Truncated>
<Typography component="s" color="text.secondary">
Copy link
Contributor

Choose a reason for hiding this comment

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

what is s?

{formatStrategyName(change.payload.name)}
</Typography>
</TooltipLink>
{<StrategyName change={change} previousTitle={previousTitle} />}
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 not sure if we should couple strategy name to the entire change request. Maybe the API should be: strategyName, oldTitle, newTitle to express what really matters

@sjaanus sjaanus merged commit 54654c6 into main Jun 19, 2023
11 of 17 checks passed
@sjaanus sjaanus deleted the strategy-diff branch June 19, 2023 10:33
thomasheartman added a commit that referenced this pull request Aug 8, 2023
This change addresses two things that were done in
#4004 and that I believe to be bugs.

1. It shows the previous strategy name also if there was no previous
title. So if there was no previous title, it'll show the strategy name
with a strikethrough and then the new title.
2. It changes a `span` component to a `del` component. I believe the
span was erroneously changed from a `s` component (strikethrough
component) in the linked PR (based on a comment on the PR). This
caused the strikethrough to not be there anymore. However, the `del`
component is semantically more correct and reintroduces the
strikethrough, so it is a better change.

Finally, it removes a redundant pair of curly braces.
thomasheartman added a commit that referenced this pull request Aug 9, 2023
This change addresses two things that were done in
#4004 and that I believe to be
bugs.

1. It shows the previous strategy name also if there was no previous
title. So if there was no previous title, it'll show the strategy name
with a strikethrough and then the new title (see the discussion
section).
2. It changes a `span` component to a [`del`
component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del).
I believe the
span was erroneously changed from a `s` component (strikethrough
component) in the linked PR (based on a comment on the PR). This
caused the strikethrough to not be there anymore. However, the `del`
component is semantically more correct and reintroduces the
strikethrough, so it is a better change.
3. It uses [`ins`
elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins)
for names that have changed.

Finally, it removes a redundant pair of curly braces.

How it looks now:


![image](https://github.com/Unleash/unleash/assets/17786332/a9947619-056d-4cd8-8b44-8a562c83ba40)


## Discussion

Regarding point 1: It might be that we don't want to show a
strikethrough through the name of the strategy if there was no previous
title. In that case, the changes related to the first point should be
removed. If we do that, it looks like this:


![image](https://github.com/Unleash/unleash/assets/17786332/aeb6c86c-d283-4703-96e6-c4302d252417)

It makes it harder (impossible, actually) to see when a custom title was
added, but that might be what we want.

But maybe the solution is to also use `ins` elements for new data. That
way the difference is visible (and semantically correct):

![image](https://github.com/Unleash/unleash/assets/17786332/ef13a745-9f9c-4b1a-886f-a7917eb12190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants