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: sticky insights header and widget tooltip icon #6537

Merged
merged 7 commits into from
Mar 14, 2024

Conversation

andreas-unleash
Copy link
Contributor

@andreas-unleash andreas-unleash commented Mar 13, 2024

What it says on the tin

Closes # 1-2182

Screenshot 2024-03-14 at 10 47 32
Screen.Recording.2024-03-14.at.11.27.52.mov

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

vercel bot commented Mar 13, 2024

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 Mar 14, 2024 9:23am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 14, 2024 9:23am

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

✅ Improving Code Health:

export const ExecutiveDashboard: VFC = () => {
const [scrolled, setScrolled] = useState(false);

Choose a reason for hiding this comment

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

❌ New issue: Complex Method
ExecutiveDashboard:VFC has a cyclomatic complexity of 10, threshold = 10

Why does this problem occur?

This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.

To ignore this warning click here.

@@ -85,7 +109,7 @@ export const ExecutiveDashboard: VFC = () => {
/>
}
/>
</Box>

Choose a reason for hiding this comment

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

✅ No longer an issue: Large Method
ExecutiveDashboard:VFC is no longer above the threshold for lines of code

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

✅ Improving Code Health:

@andreas-unleash andreas-unleash changed the title Feat: sticky insights header Feat: sticky insights header and widget tooltip icon Mar 14, 2024
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link
Contributor

@FredrikOseberg FredrikOseberg left a comment

Choose a reason for hiding this comment

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

LGTM, but I'm curious about the complexity needed to record the scrolling

position: 'sticky',
top: 0,
zIndex: 1000,
padding: scrolled ? theme.spacing(2, 0) : theme.spacing(0, 0, 2),
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 curious what this does in practice? Why does the padding need to be different for the header once we scroll?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this gets pinned to to the top it looks weird with 0 padding (the search input label is almost half visible). When you are at the top - even the 2 px padding makes it inconsistent with other pages with empty breadcrumbs. This with the small transition makes it look ok. I added a video of how it looks

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

✅ Improving Code Health:

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 2 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Lightweight sanity check
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

✅ Improving Code Health:

@@ -27,13 +27,15 @@ export const createOptions = (
},
tooltip: {
enabled: false,
position: 'nearest',

Choose a reason for hiding this comment

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

❌ Getting worse: Large Method
createOptions increases from 73 to 75 lines of code, threshold = 70

Why does this problem occur?

Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function. Read more.

To ignore this warning click here.

@andreas-unleash andreas-unleash merged commit 513d60c into main Mar 14, 2024
13 checks passed
@andreas-unleash andreas-unleash deleted the feat/sticky_insights_header branch March 14, 2024 09:33
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