-
Notifications
You must be signed in to change notification settings - Fork 10
fix(bookmark): show app name loading state #5111
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
Merged
odinr
merged 3 commits into
equinor:main
from
hugosmoreira:agent/fix-edit-bookmark-loading-skeleton
Jul 30, 2026
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@equinor/fusion-framework-react-components-bookmark": patch | ||
| --- | ||
|
|
||
| Show accessible loading feedback for the app name while the edit bookmark modal resolves its app manifest. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/react/components/bookmark/src/__tests__/AppNameField.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { isValidElement } from 'react'; | ||
| import { Input, Progress } from '@equinor/eds-core-react'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { AppNameField } from '../components/edit-bookmark/AppNameField'; | ||
|
|
||
| describe('AppNameField', () => { | ||
| it('shows an accessible progress indicator while the manifest is loading', () => { | ||
| const field = AppNameField({ isLoading: true }); | ||
| const loadingIndicator = field.props.rightAdornments; | ||
|
|
||
| expect(field.type).toBe(Input); | ||
| expect(field.props['aria-busy']).toBe(true); | ||
| expect(isValidElement(loadingIndicator)).toBe(true); | ||
|
|
||
| // Guard the element shape before inspecting progress-specific props. | ||
| if (!isValidElement(loadingIndicator)) { | ||
| throw new Error('Expected a valid loading indicator'); | ||
| } | ||
|
|
||
| expect(loadingIndicator.type).toBe(Progress.Circular); | ||
| expect(loadingIndicator.props).toMatchObject({ | ||
| 'aria-label': 'Loading app name', | ||
| size: 16, | ||
| }); | ||
| }); | ||
|
|
||
| it('shows the resolved display name without a progress indicator', () => { | ||
| const field = AppNameField({ | ||
| displayName: 'My app', | ||
| isLoading: false, | ||
| }); | ||
|
|
||
| expect(field.props.value).toBe('My app'); | ||
| expect(field.props['aria-busy']).toBe(false); | ||
| expect(field.props.rightAdornments).toBeUndefined(); | ||
| }); | ||
| }); |
25 changes: 25 additions & 0 deletions
25
packages/react/components/bookmark/src/components/edit-bookmark/AppNameField.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { Input, Progress } from '@equinor/eds-core-react'; | ||
|
|
||
| /** | ||
| * Renders the bookmark's app name while making manifest resolution visible. | ||
| * | ||
| * @param props - The resolved display name and whether the manifest request is pending. | ||
| * @returns A read-only app name field with an accessible loading indicator when needed. | ||
| */ | ||
| export const AppNameField = ({ | ||
| displayName, | ||
| isLoading, | ||
| }: { | ||
| readonly displayName?: string; | ||
| readonly isLoading: boolean; | ||
| }) => ( | ||
| <Input | ||
| id="app" | ||
| readOnly={true} | ||
| value={displayName ?? ''} | ||
| aria-busy={isLoading} | ||
| rightAdornments={ | ||
| isLoading ? <Progress.Circular aria-label="Loading app name" size={16} /> : undefined | ||
| } | ||
| /> | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { defineProject } from 'vitest/config'; | ||
|
|
||
| import { name, version } from './package.json'; | ||
|
|
||
| export default defineProject({ | ||
| test: { | ||
| include: ['src/__tests__/**/*.{test,spec}.{ts,tsx}'], | ||
| name: `${name}@${version}`, | ||
| }, | ||
| }); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.