Skip to content

Conversation

@tskarhed
Copy link
Contributor

@tskarhed tskarhed commented Nov 4, 2025

What is this feature?

  • Adds local mocks for scopes and scope navigations, served with MSW
  • Adds support for nested subScope
image

Why do we need this feature?

To easier move between context

Who is this feature for?

Scopes users

Which issue(s) does this PR fix?:

Closes https://github.com/grafana/hyperion-planning/issues/446

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

Comment on lines 59 to +60
// Expand the group that matches the current path, if it is not already expanded
private onLocationChange = (pathname: string) => {
private onLocationChange = async (pathname: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to verify this functionality and how it handles expanion

url: string;
// Used for testid and keys
id: string;
hasSubScope?: boolean;
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 should not be needed on the status.

const isCurrent = isCurrentPath(locPathname, to);

// Use exchange-alt icon for subScope items
const iconName = hasSubScope ? 'exchange-alt' : linkIcon;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

subScope items should be rendered as folders, so no need for this here.

const isEmpty =
Object.keys(currentFolder.folders).length === 0 && Object.keys(currentFolder.suggestedNavigations).length === 0;

if (isEmpty) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do an early return instead

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.

1 participant