Skip to content

Conversation

@JamalAlabdullah
Copy link
Contributor

@JamalAlabdullah JamalAlabdullah commented Nov 10, 2025

Description

Verification

  • Related issues are connected (if applicable)
  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Summary by CodeRabbit

Release Notes

  • New Features

    • Logo now links to the home page.
  • Style

    • Updated navigation menu spacing and styling for improved clarity.
    • Refined header link colors for visual consistency.
    • Enhanced dropdown menu interactions and behavior.
    • Improved button styling across header components.
  • Bug Fixes

    • Enhanced accessibility for menu item navigation.

@github-actions github-actions bot added area/dashboard Area: Related to the dashboard application area/app-preview Area: Related to test and preview of apps that are developed in Altinn Studio. area/version-control Area: Related to version control for files in apps. skip-releasenotes Issues that do not make sense to list in our release notes area/resource-registry area/studio-root Area: Issues related to studio-root application frontend solution/studio/designer labels Nov 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

This pull request migrates Studio UI components from a legacy package (@studio/components-legacy) to the main @studio/components package, removes styling-related props (color, variant, ariaLabelTriggerButton) from component APIs, refactors dropdown menu state management from callback-based to context-driven, and updates CSS styling for consistency.

Changes

Cohort / File(s) Summary
Import Path Migrations (Legacy → Main Package)
src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx, src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.tsx, src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx, src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx, src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx, src/Designer/frontend/app-development/test/headerMocks.ts, src/Designer/frontend/app-preview/src/views/LandingPage.tsx, src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx, src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/LargeNavigationMenu/LargeNavigationMenu.tsx, src/Designer/frontend/dashboard/types/NavigationMenuItem.ts, src/Designer/frontend/dashboard/utils/headerUtils/*, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/..., src/Designer/frontend/packages/shared/src/components/GiteaHeader/..., src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx, src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
Updated import sources for StudioPageHeader, StudioAvatar, StudioLinkButton, and profile menu types from @studio/components-legacy to @studio/components; all logic and behavior preserved.
Props Removal & Attribute Updates
src/Designer/frontend/admin/layout/PageHeader.tsx, src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx, src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx, src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx, src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx, src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/*/..., src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx
Removed ariaLabelTriggerButton, color, and variant props from StudioPageHeader.ProfileMenu and HeaderLink; replaced color prop with data-color attribute; components now rely on defaults.
Component Replacement & Refactoring
src/Designer/frontend/admin/layout/PageHeader.tsx, src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx, src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx, src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx
Replaced StudioPageHeader.HeaderButton with HeaderLink using renderLink callback; replaced NavLink with StudioLinkButton; refactored dropdown menu state from callback-based (onClickItem) to context-driven (useStudioDropdownContext); added menu item role="menuitem" with context-based close handling.
CSS Styling Updates
src/Designer/frontend/app-development/layout/App.css, src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.module.css, src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeader.module.css, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderHeaderLink/StudioPageHeaderHeaderLink.module.css, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.module.css
Added/updated color properties using design tokens (e.g., var(--ds-color-neutral-background-default)); removed gap/padding rules; updated link styling and active border colors; added visited link color inheritance.
Test Updates
src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx, src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx
Changed test queries from screen.getByTitle/queryByTitle to screen.getByText/queryByText; updated role selectors from link to menuitem for dropdown menu items.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Import migrations: Most repetitive and low-risk; straightforward path updates across 15+ files requiring minimal scrutiny per file.
  • Props removal pattern: Consistent across multiple files (ProfileMenu, HeaderLink, PopoverTrigger); verify no unintended visual/behavioral side effects from prop removal.
  • Dropdown context refactoring: Review StudioPageHeaderProfileMenu.tsx and related context usage carefully; the shift from explicit callback (onClickItem) to implicit context-driven close (setOpen via useStudioDropdownContext) requires ensuring menu closes reliably and that role="menuitem" + onClick integration works as expected across different use cases.
  • Component replacements (HeaderButton → HeaderLink, renderLink callback): Verify PreviewButton and AppPreviewSubMenu replacement logic produces identical UI and navigation behavior; ensure renderLink callback returns correct StudioLinkButton structure.
  • CSS changes: Generally straightforward; verify color tokens resolve correctly and that gap/padding removals don't break spacing in LargeNavigationMenu and other affected layouts.
  • Type signature update: StudioPageHeaderPopoverTriggerProps simplification from { color?: ...; variant?: ... } & StudioPopoverTriggerProps to {} & StudioPopoverTriggerProps should be validated for no breakage in component consumers.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The pull request description is incomplete. Only the template structure is present with no substantive details about the changes, objectives, or rationale. Provide a detailed description explaining what the PR does (migrating legacy StudioPageHeader usage), why these changes are necessary, and how they impact the codebase. Include specific examples of components updated.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating usage of the legacy StudioPageHeader component to a new component and removing the old one. It accurately reflects the primary objective evident across all file changes in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 16650-migrate-usage-of-legacy-studiopageheader-with-the-new-component-and-remove-the-old-one

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx (1)

119-140: Critical: Link onClick closes dropdown unconditionally, breaking openInNewTab behavior.

The handleClick at line 123 always calls setOpen(false), but the test at lines 175-186 in the test file expects links with openInNewTab: true to keep the dropdown open. Links that open in a new tab should allow users to continue selecting other menu items.

Apply this diff to close the dropdown only for same-window navigation:

 const StudioProfileMenuLink = ({ item }: StudioProfileMenuLinkProps): ReactElement => {
   const { href, openInNewTab } = item.action;
   const { setOpen } = useStudioDropdownContext();
 
-  const handleClick = (): void => setOpen(false);
+  const handleClick = (): void => {
+    if (!openInNewTab) setOpen(false);
+  };
 
   return (
     <StudioDropdown.Item>
       <StudioDropdown.Button asChild>
         <a
           href={href}
           target={openInNewTab ? '_blank' : undefined}
           rel={openInNewTab ? 'noopener noreferrer' : undefined}
           role='menuitem'
           onClick={handleClick}
         >
           {item.itemName}
         </a>
       </StudioDropdown.Button>
     </StudioDropdown.Item>
   );
 };
🧹 Nitpick comments (1)
src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx (1)

35-35: Use self-closing tag for empty element.

Apply this diff:

-    ></StudioPageHeader.HeaderLink>
+    />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a18e920 and 54ffb19.

📒 Files selected for processing (33)
  • src/Designer/frontend/admin/layout/PageHeader.tsx (2 hunks)
  • src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx (1 hunks)
  • src/Designer/frontend/app-development/layout/App.css (1 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.module.css (1 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.tsx (2 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx (2 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx (1 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx (2 hunks)
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx (2 hunks)
  • src/Designer/frontend/app-development/test/headerMocks.ts (1 hunks)
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css (1 hunks)
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx (2 hunks)
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx (2 hunks)
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx (1 hunks)
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx (2 hunks)
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx (1 hunks)
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/LargeNavigationMenu/LargeNavigationMenu.tsx (1 hunks)
  • src/Designer/frontend/dashboard/types/NavigationMenuItem.ts (1 hunks)
  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts (1 hunks)
  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.ts (1 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeader.module.css (1 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderHeaderLink/StudioPageHeaderHeaderLink.module.css (1 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.module.css (0 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx (2 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx (1 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx (1 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx (4 hunks)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx (4 hunks)
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx (3 hunks)
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/FetchChangesPopover/FetchChangesPopover.tsx (2 hunks)
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/ShareChangesPopover/ShareChangesPopover.tsx (2 hunks)
  • src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx (1 hunks)
  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.module.css
🧰 Additional context used
🧠 Learnings (31)
📓 Common learnings
Learnt from: mgunnerud
Repo: Altinn/altinn-studio PR: 16187
File: frontend/resourceadm/components/ResourcePageInputs/ResourceSwitchInput.tsx:3-3
Timestamp: 2025-08-25T13:55:27.042Z
Learning: In the Altinn Studio codebase, when migrating from studio/components-legacy to studio/components, PRs should focus only on components that have available replacements in the new package. Components without new implementations should remain in the legacy package until replacements are available, supporting an incremental migration approach.
Learnt from: framitdavid
Repo: Altinn/altinn-studio PR: 16372
File: src/Designer/frontend/libs/studio-components/src/components/index.ts:34-34
Timestamp: 2025-09-23T08:53:19.508Z
Learning: In the Altinn Studio codebase, when moving components from studio-components-legacy to studio-components, the team prefers to handle the component migration and remaining import updates in separate PRs to maintain focused, atomic changes.
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15977
File: frontend/libs/studio-components-legacy/src/components/StudioCard/index.tsx:2-7
Timestamp: 2025-08-06T12:36:57.397Z
Learning: When a developer copies a component from `studio-components-legacy` to `studio-components` in the Altinn Studio repository and has not added a deprecation comment for the component in `studio-components-legacy`, suggest adding the deprecation comment in the PR review.
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15977
File: frontend/libs/studio-components-legacy/src/components/StudioCard/index.tsx:2-7
Timestamp: 2025-08-06T12:37:01.381Z
Learning: When reviewing PRs in the Altinn Studio repository where a developer copies a component from `studio-components-legacy` to `studio-components`, suggest adding a `deprecated` JSDoc comment to the component in `studio-components-legacy` if one hasn't been added. The deprecation comment should recommend using the component from `studio/components` instead.
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 0
File: :0-0
Timestamp: 2025-09-10T12:02:06.348Z
Learning: In the Altinn Studio repository, the team convention is to remove irrelevant checkboxes from the PR template description rather than leaving them unmarked. This makes it clear that the author has intentionally considered each item and removed non-applicable ones, helping to avoid merging PRs with incomplete checklists.
Learnt from: mirkoSekulic
Repo: Altinn/altinn-studio PR: 16095
File: src/App/app-template-dotnet/src/App/models/model.cs:10-29
Timestamp: 2025-08-15T05:53:32.529Z
Learning: When moving app templates in Altinn Studio, mirkoSekulic prefers to keep the PR scope strictly limited to the move operation itself, with all content changes (including code quality improvements, naming convention fixes, and attribute cleanup) deferred to separate PRs for better maintainability and atomic changes.
Learnt from: lassopicasso
Repo: Altinn/altinn-studio PR: 14575
File: frontend/packages/ux-editor/src/components/config/componentSpecificContent/Summary2/Override/OverrideFields/Summary2OverrideDisplayType.tsx:47-58
Timestamp: 2025-02-07T09:50:33.290Z
Learning: Avoid suggesting StudioCombobox component in future PRs for the Altinn Studio repository. A new replacement component will be introduced later.
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 16123
File: frontend/libs/studio-components/src/types/OverridableComponentProps.ts:3-6
Timestamp: 2025-08-15T08:21:51.564Z
Learning: ErlingHauan prefers to keep PRs that move types from studio-components-legacy to studio-components focused strictly on the move operation, deferring type implementation changes or improvements to separate PRs for better maintainability and atomic changes.
Learnt from: mirkoSekulic
Repo: Altinn/altinn-studio PR: 16191
File: .dockerignore:3-3
Timestamp: 2025-08-26T12:35:44.069Z
Learning: In the Altinn Studio repository, mirkoSekulic is implementing a phased directory restructuring approach where backend and testdata are moved first, followed by separate moves for readme, frontend, and development directories into the Designer directory. This ensures atomic changes and prevents path reference issues during the transition.
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 16081
File: frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditTab/OptionListSelector/OptionListSelector.tsx:108-115
Timestamp: 2025-08-12T13:45:39.680Z
Learning: The StudioButton component from studio/components-legacy defaults to type="button", so explicit type attributes are not needed to prevent form submission behavior.
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15981
File: frontend/libs/studio-components/src/components/StudioLabelAsParagraph/StudioLabelAsParagraph.tsx:10-10
Timestamp: 2025-08-07T13:08:11.913Z
Learning: In the Altinn Studio codebase, when using components with the `asChild` prop pattern (like from digdir/designsystemet-react), the ref should be placed on the child DOM element rather than forwarded to the parent component. This pattern was established in PR #15998 where Card asChild was used with StudioFieldset, and the ref was passed to the StudioFieldset (child) not the Card (parent). This approach provides correct TypeScript typing automatically since the ref points directly to the actual DOM element being rendered.
Learnt from: framitdavid
Repo: Altinn/altinn-studio PR: 14494
File: frontend/app-development/features/appPublish/components/UndeployConsequenceDialog/UndeployConsequenceDialog.tsx:21-27
Timestamp: 2025-01-23T14:49:32.407Z
Learning: The StudioModal component from studio/components already includes built-in support for dialog close handling, keyboard interaction (Esc key), and focus trap for accessibility.
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 0
File: :0-0
Timestamp: 2025-09-26T12:03:51.850Z
Learning: In PR #16443, TomasEng clarified that the ExpressionTexts type in studio/components does not require additional keys like dataModel, resource, or missingDataModelLabel that were suggested in a review comment. TypeScript compilation would catch any missing required properties, confirming the migration is correctly implemented.
📚 Learning: 2025-08-25T13:55:27.042Z
Learnt from: mgunnerud
Repo: Altinn/altinn-studio PR: 16187
File: frontend/resourceadm/components/ResourcePageInputs/ResourceSwitchInput.tsx:3-3
Timestamp: 2025-08-25T13:55:27.042Z
Learning: In the Altinn Studio codebase, when migrating from studio/components-legacy to studio/components, PRs should focus only on components that have available replacements in the new package. Components without new implementations should remain in the legacy package until replacements are available, supporting an incremental migration approach.

Applied to files:

  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.ts
  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
📚 Learning: 2025-10-06T17:51:23.307Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16518
File: src/Designer/frontend/libs/studio-components/src/components/StudioToggleableTextfieldSchema/StudioToggleableTextfieldSchema.stories.tsx:2-3
Timestamp: 2025-10-06T17:51:23.307Z
Learning: Altinn/altinn-studio: In Storybook stories (*.stories.tsx) under Designer/frontend libs, the project convention is to import types (Meta, StoryFn/StoryObj) from 'storybook/react-vite' rather than 'storybook/react'. Prefer 'storybook/react-vite' in future reviews for consistency.

Applied to files:

  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.ts
  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/test/headerMocks.ts
  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts
  • src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/FetchChangesPopover/FetchChangesPopover.tsx
  • src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
  • src/Designer/frontend/dashboard/types/NavigationMenuItem.ts
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx
📚 Learning: 2025-09-24T07:36:20.665Z
Learnt from: CR
Repo: Altinn/altinn-studio PR: 0
File: src/App/frontend/CLAUDE.md:0-0
Timestamp: 2025-09-24T07:36:20.665Z
Learning: Applies to src/App/frontend/src/layout/*/{config.ts,Component.tsx,index.tsx,config.generated.ts} : Layout components must follow the standardized structure: include `config.ts`, `Component.tsx`, `index.tsx`, and generated `config.generated.ts` in each `src/layout/<Component>/` directory

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/LargeNavigationMenu/LargeNavigationMenu.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
📚 Learning: 2025-11-03T08:16:33.782Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16865
File: src/Designer/frontend/app-preview/src/components/PreviewControlHeader/PreviewControlHeader.tsx:44-50
Timestamp: 2025-11-03T08:16:33.782Z
Learning: In PreviewControlHeader.tsx (app-preview package), JamalAlabdullah confirmed that the StudioSelect component for layout set selection is acceptable with an empty label prop (label={''}), indicating this is an intentional design decision for that specific component.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx
📚 Learning: 2025-10-25T11:48:49.152Z
Learnt from: lassopicasso
Repo: Altinn/altinn-studio PR: 16740
File: src/Designer/frontend/packages/ux-editor/src/components/Properties/PageConfigPanel/PageConfigPanel.tsx:63-71
Timestamp: 2025-10-25T11:48:49.152Z
Learning: In src/Designer/frontend/packages/ux-editor/src/components/Properties/PageConfigPanel/PageConfigPanel.tsx, the NameConfig component is intentionally rendered in two places: once in the mainConfig section and once inside the "Text" accordion section. This duplication is by design.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
📚 Learning: 2025-08-12T06:09:55.275Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 16064
File: frontend/libs/studio-components/src/components/StudioCheckboxGroup/StudioGetCheckboxProps.ts:1-1
Timestamp: 2025-08-12T06:09:55.275Z
Learning: In the Altinn Studio codebase, the preferred approach for eliminating dependencies on deep imports from digdir/designsystemet-react is to make the code completely independent of deep imports rather than using shared wrappers. This approach would eliminate the need for import path adjustments during future Design System package updates.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
📚 Learning: 2025-09-26T12:03:56.908Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 0
File: :0-0
Timestamp: 2025-09-26T12:03:56.908Z
Learning: In the Altinn Studio codebase, when reviewing migration from studio/components-legacy to studio/components for the StudioExpression component, the ExpressionTexts type interface does not require additional keys like `dataModel`, `resource`, or `missingDataModelLabel`. TypeScript compilation will catch any missing required properties, so successful builds indicate proper type compliance.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/test/headerMocks.ts
  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx
  • src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx
  • src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
  • src/Designer/frontend/dashboard/types/NavigationMenuItem.ts
📚 Learning: 2025-09-23T08:53:19.508Z
Learnt from: framitdavid
Repo: Altinn/altinn-studio PR: 16372
File: src/Designer/frontend/libs/studio-components/src/components/index.ts:34-34
Timestamp: 2025-09-23T08:53:19.508Z
Learning: In the Altinn Studio codebase, when moving components from studio-components-legacy to studio-components, the team prefers to handle the component migration and remaining import updates in separate PRs to maintain focused, atomic changes.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
📚 Learning: 2025-08-12T05:59:20.146Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 16064
File: frontend/libs/studio-components/src/components/StudioCheckboxGroup/StudioGetCheckboxProps.ts:1-1
Timestamp: 2025-08-12T05:59:20.146Z
Learning: In the Altinn Studio codebase, deep exports from digdir/designsystemet-react should be avoided. The team prefers using shared wrappers for design system imports to prevent breakage from upstream internal path changes, but such refactoring should be done in separate PRs to maintain focused scope.

Applied to files:

  • src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/LargeNavigationMenu/LargeNavigationMenu.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx
  • src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx
📚 Learning: 2025-09-24T07:36:20.665Z
Learnt from: CR
Repo: Altinn/altinn-studio PR: 0
File: src/App/frontend/CLAUDE.md:0-0
Timestamp: 2025-09-24T07:36:20.665Z
Learning: Applies to src/App/frontend/src/__mocks__/** : Mock external dependencies under `src/__mocks__/`

Applied to files:

  • src/Designer/frontend/app-development/test/headerMocks.ts
📚 Learning: 2025-09-26T12:03:51.850Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 0
File: :0-0
Timestamp: 2025-09-26T12:03:51.850Z
Learning: In PR #16443, TomasEng clarified that the ExpressionTexts type in studio/components does not require additional keys like dataModel, resource, or missingDataModelLabel that were suggested in a review comment. TypeScript compilation would catch any missing required properties, confirming the migration is correctly implemented.

Applied to files:

  • src/Designer/frontend/app-development/test/headerMocks.ts
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx
📚 Learning: 2025-10-28T20:54:18.494Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16787
File: src/Designer/frontend/packages/ux-editor-v3/src/components/toolbar/RuleModal.test.tsx:70-70
Timestamp: 2025-10-28T20:54:18.494Z
Learning: Test inconsistencies in the ux-editor-v3 package do not need to be fixed, as indicated by the maintainer for the file `src/Designer/frontend/packages/ux-editor-v3/src/components/toolbar/RuleModal.test.tsx`.

Applied to files:

  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx
📚 Learning: 2025-09-24T07:36:20.665Z
Learnt from: CR
Repo: Altinn/altinn-studio PR: 0
File: src/App/frontend/CLAUDE.md:0-0
Timestamp: 2025-09-24T07:36:20.665Z
Learning: Applies to src/App/frontend/src/**/*.test.{ts,tsx} : In tests that require form layout context, use `renderWithProviders` from `src/test/renderWithProviders.tsx`

Applied to files:

  • src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx
  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx
📚 Learning: 2025-10-26T21:09:38.402Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16742
File: src/Designer/frontend/packages/schema-editor/src/components/SchemaInspector/ItemDataComponent.module.css:23-25
Timestamp: 2025-10-26T21:09:38.402Z
Learning: In the Altinn Studio codebase, the design system is migrating from `--fds-*` prefixed CSS variables to `--ds-*` prefixed variables. The `--fds-*` prefix will be removed in the future, so usage of `--ds-*` variables (like `--ds-size-4`) alongside existing `--fds-*` variables (like `--fds-spacing-4`) in the same file is intentional during this transition period.
<!--

Applied to files:

  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeader.module.css
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderHeaderLink/StudioPageHeaderHeaderLink.module.css
  • src/Designer/frontend/app-development/layout/App.css
  • src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.module.css
📚 Learning: 2025-06-18T12:34:13.539Z
Learnt from: lassopicasso
Repo: Altinn/altinn-studio PR: 15495
File: frontend/packages/ux-editor/src/components/TasksTable/TasksTable.tsx:77-83
Timestamp: 2025-06-18T12:34:13.539Z
Learning: In the TasksTable component at frontend/packages/ux-editor/src/components/TasksTable/TasksTable.tsx, the preview link uses CSS-based disabling with the `.disabledPreviewLink` class, which includes `pointer-events: none`, `opacity: 0.5`, and `cursor: not-allowed` to properly disable interactions when tasks.length === 0.

Applied to files:

  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx
  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx
📚 Learning: 2025-09-24T07:36:20.665Z
Learnt from: CR
Repo: Altinn/altinn-studio PR: 0
File: src/App/frontend/CLAUDE.md:0-0
Timestamp: 2025-09-24T07:36:20.665Z
Learning: Prefer Digdir Design System components when possible

Applied to files:

  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx
📚 Learning: 2025-08-12T13:45:39.680Z
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 16081
File: frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditTab/OptionListSelector/OptionListSelector.tsx:108-115
Timestamp: 2025-08-12T13:45:39.680Z
Learning: The StudioButton component from studio/components-legacy defaults to type="button", so explicit type attributes are not needed to prevent form submission behavior.

Applied to files:

  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx
  • src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx
📚 Learning: 2025-11-03T18:58:18.996Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 16876
File: src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListsPage/CodeListsPage.tsx:17-23
Timestamp: 2025-11-03T18:58:18.996Z
Learning: In src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListsPage/CodeListsPage.tsx, the CodeListsPage component is intentionally an uncontrolled component where the codeLists prop only initializes state on mount and does not synchronize when the prop changes. This is because the createCodeListMap function generates random UUIDs for keys, making it impure. Re-calling it after the first render would reassign keys and significantly disrupt the UI (unmounting/remounting components). The component manages its own state for draft/editing purposes, and the prop is not expected to change to anything that doesn't correspond to the internal state.

Applied to files:

  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/admin/layout/PageHeader.tsx
📚 Learning: 2025-01-13T12:44:45.751Z
Learnt from: Jondyr
Repo: Altinn/altinn-studio PR: 14379
File: frontend/packages/ux-editor/src/components/config/componentSpecificContent/Summary2/Override/Summary2OverrideEntry.tsx:63-70
Timestamp: 2025-01-13T12:44:45.751Z
Learning: In the Altinn Studio codebase, when using StudioProperty.Button component, it's expected to pass `false` as the value prop when no meaningful value is available (e.g., when componentNameType is undefined). This is the intended behavior and should not be changed to handle undefined cases differently.

Applied to files:

  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
📚 Learning: 2025-09-30T21:12:14.088Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16474
File: src/Designer/frontend/libs/studio-components/src/components/StudioIconCard/StudioIconCard.tsx:38-47
Timestamp: 2025-09-30T21:12:14.088Z
Learning: In the StudioPopover component within studio-components (DS V1), the `size` prop is no longer used. Instead, size is controlled via the `data-size` attribute (e.g., `data-size='sm'`).

Applied to files:

  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/ShareChangesPopover/ShareChangesPopover.tsx
📚 Learning: 2025-10-29T07:11:59.228Z
Learnt from: JamalAlabdullah
Repo: Altinn/altinn-studio PR: 16787
File: src/Designer/frontend/packages/ux-editor/src/components/config/editModal/EditImage/LocalImage/PreviewImageSummary/DeleteOptionsModal/DeleteOptionsModal.tsx:18-30
Timestamp: 2025-10-29T07:11:59.228Z
Learning: The StudioDialog component from studio/components includes built-in support for dialog close handling, with a close button in the header and keyboard interaction (Esc key) for accessibility.

Applied to files:

  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx
📚 Learning: 2025-06-04T06:37:16.617Z
Learnt from: mlqn
Repo: Altinn/altinn-studio PR: 15495
File: frontend/app-development/layout/VersionAlerts/OutdatedVersionAlertRemindChoiceDialog.tsx:0-0
Timestamp: 2025-06-04T06:37:16.617Z
Learning: In the OutdatedVersionAlertRemindChoiceDialog component in frontend/app-development/layout/VersionAlerts/OutdatedVersionAlertRemindChoiceDialog.tsx, the onOpen handler uses `setOpened(!opened)` to toggle the popover state. This is expected behavior where the trigger button serves as both an open and close control for the popover.

Applied to files:

  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/FetchChangesPopover/FetchChangesPopover.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/ShareChangesPopover/ShareChangesPopover.tsx
  • src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx
📚 Learning: 2025-03-12T14:19:41.785Z
Learnt from: Konrad-Simso
Repo: Altinn/altinn-studio PR: 14952
File: frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditTab/OptionListEditor/ManualOptionsEditor/ManualOptionsEditor.test.tsx:57-57
Timestamp: 2025-03-12T14:19:41.785Z
Learning: TODO comments in the codebase mentioning "Todo: Replace 'close modal' with defaultDialogProps.closeButtonTitle" will be addressed when upgrading to Designsystemet v1, which is currently being worked on.

Applied to files:

  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx
📚 Learning: 2025-08-07T13:08:11.913Z
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15981
File: frontend/libs/studio-components/src/components/StudioLabelAsParagraph/StudioLabelAsParagraph.tsx:10-10
Timestamp: 2025-08-07T13:08:11.913Z
Learning: In the Altinn Studio codebase, when using components with the `asChild` prop pattern (like from digdir/designsystemet-react), the ref should be placed on the child DOM element rather than forwarded to the parent component. This pattern was established in PR #15998 where Card asChild was used with StudioFieldset, and the ref was passed to the StudioFieldset (child) not the Card (parent). This approach provides correct TypeScript typing automatically since the ref points directly to the actual DOM element being rendered.

Applied to files:

  • src/Designer/frontend/admin/layout/PageHeader.tsx
  • src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
  • src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx
📚 Learning: 2025-07-08T12:20:53.578Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 15855
File: frontend/libs/studio-components-legacy/src/style/studio-variables.css:2-17
Timestamp: 2025-07-08T12:20:53.578Z
Learning: In CSS variable renaming refactoring PRs for the Altinn Studio legacy component library, the scope typically includes only exposed/exported variables (defined in studio-variables.css) that could cause naming conflicts between libraries. Internal variables used only within individual components don't need to be renamed since they don't create cross-library conflicts.

Applied to files:

  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeader.module.css
  • src/Designer/frontend/app-development/layout/App.css
📚 Learning: 2025-08-06T12:37:01.381Z
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15977
File: frontend/libs/studio-components-legacy/src/components/StudioCard/index.tsx:2-7
Timestamp: 2025-08-06T12:37:01.381Z
Learning: When reviewing PRs in the Altinn Studio repository where a developer copies a component from `studio-components-legacy` to `studio-components`, suggest adding a `deprecated` JSDoc comment to the component in `studio-components-legacy` if one hasn't been added. The deprecation comment should recommend using the component from `studio/components` instead.

Applied to files:

  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx
📚 Learning: 2025-08-06T12:36:57.397Z
Learnt from: ErlingHauan
Repo: Altinn/altinn-studio PR: 15977
File: frontend/libs/studio-components-legacy/src/components/StudioCard/index.tsx:2-7
Timestamp: 2025-08-06T12:36:57.397Z
Learning: When a developer copies a component from `studio-components-legacy` to `studio-components` in the Altinn Studio repository and has not added a deprecation comment for the component in `studio-components-legacy`, suggest adding the deprecation comment in the PR review.

Applied to files:

  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
📚 Learning: 2025-04-30T12:52:44.977Z
Learnt from: lassopicasso
Repo: Altinn/altinn-studio PR: 15313
File: frontend/packages/ux-editor/src/components/TasksTable/TasksTableBody.tsx:9-9
Timestamp: 2025-04-30T12:52:44.977Z
Learning: lassopicasso prefers to keep task-related utility functions (getTaskIcon, TaskType, isTaskReceipt) in the SettingsUtils.tsx file for now, even though they're used in multiple components including TasksTableBody.tsx. This is an intentional organizational decision.

Applied to files:

  • src/Designer/frontend/app-preview/src/views/LandingPage.tsx
📚 Learning: 2025-06-16T12:41:06.726Z
Learnt from: TomasEng
Repo: Altinn/altinn-studio PR: 15659
File: frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditTab/CodeListDialog/CodeListDialog.test.tsx:145-151
Timestamp: 2025-06-16T12:41:06.726Z
Learning: In the Altinn Studio codebase, TomasEng has confirmed that using `expect(screen.getByRole('dialog')).toBeVisible` directly with `waitFor` is acceptable and equivalent to wrapping it in a function callback. This pattern is intentionally used in their testing setup.

Applied to files:

  • src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx
📚 Learning: 2025-08-08T13:24:30.117Z
Learnt from: nkylstad
Repo: Altinn/altinn-studio PR: 0
File: :0-0
Timestamp: 2025-08-08T13:24:30.117Z
Learning: In Altinn/altinn-studio PR reviews, when unit tests need React Query/TanStack Query data, prefer seeding with QueryClient.setQueryData over rendering/mocking use…Query hooks and waiting for isSuccess. Flag patterns like renderHookWithMockStore(() => use…Query(...)) and waitFor(() => expect(result.current.isSuccess).toBe(true)) and recommend the simpler setQueryData approach. Cite the internal Confluence guideline on component tests and the best-practice example in useAddItemToLayoutMutation.test.ts (lines updated 08.08.2025).

Applied to files:

  • src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx
🧬 Code graph analysis (5)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx (1)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogo.tsx (1)
  • DigdirLogo (3-13)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx (3)
src/Designer/frontend/libs/studio-components/src/components/StudioDropdown/StudioDropdown.tsx (1)
  • StudioDropdown (20-59)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/types/StudioProfileMenuGroup.ts (1)
  • StudioProfileMenuGroup (3-5)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/types/StudioProfileMenuItem.ts (1)
  • StudioProfileMenuItem (1-6)
src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx (1)
src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx (1)
  • usePageHeaderContext (72-78)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/StudioPageHeaderLeft.tsx (1)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx (1)
  • DigdirLogoLink (12-26)
src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx (1)
src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ClonePopoverContent/ClonePopoverContent.tsx (1)
  • ClonePopoverContent (14-68)
🔇 Additional comments (45)
src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeader.module.css (1)

1-1: Whitespace normalization only.

This is a pure formatting change (non-breaking space to standard space in the selector). No semantic or behavioral impact.

src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/ShareChangesPopover/ShareChangesPopover.tsx (2)

2-3: LGTM! Import migration correctly scoped.

The import changes appropriately migrate only StudioPageHeader from the legacy package while keeping StudioPopover and useMediaQuery in @studio/components-legacy. This follows the team's preference for atomic, focused migrations. Based on learnings.


64-75: Verify visual consistency after prop changes.

The prop updates reflect the new StudioPageHeader.PopoverTrigger API: color='light'data-color='neutral' and variant='regular'variant='tertiary'. Please verify that the button's visual appearance remains consistent with the previous implementation.

src/Designer/frontend/app-development/layout/App.css (1)

21-23: Remove this review comment; the CSS changes align with intentional codebase patterns.

The verification shows this is not a breaking change but an intentional pattern consistent throughout the codebase. Multiple other App.css files (dashboard, studio-root, resourceadm) follow the identical pattern of a { text-decoration: none; } without explicit color—indicating that link colors are managed by the component library or inherited from parent context. The presence of FDS design system tokens in the codebase confirms an active migration away from studio-* tokens, making this change deliberate and aligned with the component migration goals. The unused --studio-link-color variable in this file is benign and remains defined in :root for use by other files like admin/layout/App.css.

Likely an incorrect or invalid review comment.

src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.test.tsx (1)

114-114: LGTM! Test selectors updated to match new ARIA roles.

The test selector changes from 'link' to 'menuitem' correctly reflect the implementation changes where links are now explicitly marked with role='menuitem', which is semantically appropriate for menu items within a dropdown.

Also applies to: 127-127, 182-182, 196-196

src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderProfileMenu/StudioPageHeaderProfileMenu.tsx (2)

4-4: LGTM! Context-driven state management is cleaner.

The migration to useStudioDropdownContext() for managing dropdown state is a good improvement over callback-based prop drilling, aligning with the broader component architecture shown in StudioDropdown.tsx.

Also applies to: 40-40, 44-48


132-132: LGTM! Explicit ARIA role improves accessibility.

Adding role='menuitem' to the anchor element is semantically correct for menu items within a dropdown and aligns with ARIA best practices.

src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.test.tsx (1)

52-55: LGTM!

The test assertions correctly verify the conditional rendering of trigger button text based on screen size.

Also applies to: 64-67

src/Designer/frontend/studio-root/pages/PageLayout/PageLayout.tsx (1)

3-3: LGTM!

Import path successfully migrated from legacy to public components package.

src/Designer/frontend/app-development/contexts/PageHeaderContext/PageHeaderContext.tsx (1)

4-8: LGTM!

Type imports successfully migrated from legacy to public components package with no changes to type signatures.

src/Designer/frontend/app-development/layout/PageHeader/SubHeader/SettingsPageButton/SettingsPageButton.tsx (2)

2-3: LGTM!

Import paths correctly updated: StudioPageHeader moved to public components while useMediaQuery remains in legacy (awaiting its own migration).


45-48: LGTM!

Props correctly updated to the new API: color='light' replaced with data-color='neutral' and variant explicitly set to 'tertiary'. This aligns with the prop surface simplification in the migrated component.

src/Designer/frontend/dashboard/types/NavigationMenuItem.ts (1)

1-1: LGTM!

Type import successfully migrated from legacy to public components package.

src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderPopoverTrigger/StudioPageHeaderPopoverTrigger.tsx (2)

6-6: LGTM!

Props interface simplified by removing color and variant, now purely extending StudioPopoverTriggerProps. This is consistent with the prop surface simplification seen throughout the PR.


9-13: LGTM!

Component correctly forwards all props without providing defaults for removed color and variant props. Styling control is now delegated to consumers.

src/Designer/frontend/packages/shared/src/components/GiteaHeader/ThreeDotsMenu/ThreeDotsMenu.tsx (3)

1-7: LGTM!

Imports correctly updated: removed useState (no longer needed with TriggerContext pattern) and migrated to public components package.


21-27: LGTM!

Successfully refactored from callback-based popover to TriggerContext pattern, eliminating manual state management. Props correctly updated to data-color='neutral' and variant='tertiary'.


32-40: Verify nested TriggerContext behavior.

The nested StudioPopover.TriggerContext structure (clone popover inside the main three-dots menu popover) appears correct, but ensure that:

  1. Both popovers can be opened/closed independently
  2. Clicking the clone trigger properly opens the nested popover
  3. Closing the outer popover also closes the inner one (if that's the intended behavior)

Consider adding a manual test case to verify the nested popover interaction works as expected.

src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderHeaderLink/StudioPageHeaderHeaderLink.module.css (1)

4-5: The color token usage follows an established codebase pattern.

While --ds-color-neutral-background-default is semantically questionable for text color, this exact pattern already exists in src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css (lines 9 and 14, where it's applied to .link and .icon color properties). The PR is consistent with the codebase convention, though the broader token naming may warrant a separate design system review.

src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.ts (1)

7-7: LGTM! Clean import migration.

The import source change from @studio/components-legacy to @studio/components aligns with the broader migration effort. No behavioral changes.

src/Designer/frontend/dashboard/utils/headerUtils/headerUtils.test.ts (1)

10-10: LGTM! Test import updated consistently.

The test import follows the same migration pattern as the source file. No test logic changes.

src/Designer/frontend/app-development/test/headerMocks.ts (1)

6-6: LGTM! Mock imports updated consistently.

The mock file follows the same migration pattern. Mock data structure remains unchanged.

src/Designer/frontend/packages/shared/src/components/GiteaHeader/VersionControlButtons/components/FetchChangesPopover/FetchChangesPopover.tsx (2)

2-3: LGTM! Import split reflects incremental migration.

StudioPageHeader moved to @studio/components while other components remain in legacy package, consistent with the incremental migration approach.

Based on learnings


65-71: LGTM! Prop API updated for new component.

The prop changes (color='light'data-color='neutral', variant='regular'variant='tertiary') reflect the updated API surface of the migrated component.

src/Designer/frontend/app-development/layout/PageHeader/SmallHeaderMenu/SmallHeaderMenu.tsx (1)

4-4: LGTM! Type import migrated cleanly.

The StudioProfileMenuItem type import updated to @studio/components. No behavioral changes.

src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.tsx (2)

4-5: LGTM! Incremental migration with component replacement.

useMediaQuery remains in legacy package while StudioLink is imported from the public package, aligning with the incremental approach.

Based on learnings


17-24: LGTM! HeaderButton replaced with StudioLink.

The button component has been replaced with a link component. The className={classes.link} should provide equivalent styling. Functionality preserved with href and aria-label maintained.

src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/LargeNavigationMenu/LargeNavigationMenu.tsx (1)

5-5: LGTM! Import migrated to public package.

StudioPageHeader import moved to @studio/components. No other visible changes in the component logic.

src/Designer/frontend/resourceadm/components/ResourceAdmHeader/ResourceAdmHeader.tsx (1)

5-9: LGTM! Consolidated import from public package.

All StudioPageHeader-related types now imported from @studio/components. The migration consolidates imports and aligns with the broader refactor.

src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.module.css (1)

14-15: LGTM! Design token migration is correct.

The update from --fds-semantic-surface-neutral-default to --ds-color-text-default aligns with the design system's migration to the new token naming convention. The removal of explicit spacing/sizing values delegates styling to the component defaults, which is appropriate for this refactor.

src/Designer/frontend/app-preview/src/components/AppPreviewSubMenu/AppPreviewSubMenu.module.css (1)

8-15: LGTM! New styling classes support the component migration.

The added .link class and updated .icon class properly use the new design system tokens (--ds-color-neutral-background-default) to ensure consistent styling with the migrated StudioLink component.

src/Designer/frontend/app-preview/src/components/UserProfileMenu/UserProfileMenu.tsx (2)

6-11: LGTM! Import migration follows the incremental approach.

The migration correctly moves StudioPageHeader and related types to @studio/components while keeping StudioAvatar and useMediaQuery in the legacy package until replacements are available. This aligns with the team's incremental migration strategy.

Based on learnings


43-53: LGTM! API simplification is correctly applied.

The removal of ariaLabelTriggerButton, color, and variant props from StudioPageHeader.ProfileMenu is consistent with the API simplification across the codebase. The component retains all essential functionality through triggerButtonText, profileImage, and profileMenuGroups.

src/Designer/frontend/admin/layout/PageHeader.tsx (2)

43-51: Verify the navigation behavior change.

The replacement of NavLink with StudioLinkButton changes the navigation from React Router's client-side routing to a standard anchor link, which will trigger a full page reload when clicked. Please confirm this behavioral change is intentional for the "About" link.


3-5: LGTM! Component migration is correctly implemented.

The import consolidation and removal of ariaLabelTriggerButton, color, and variant props from ProfileMenu align with the API simplification across the codebase. All essential functionality is preserved.

Also applies to: 89-99

src/Designer/frontend/app-development/layout/PageHeader/LargeNavigationMenu/LargeNavigationMenu.tsx (2)

5-5: LGTM! Import migration is correctly implemented.

The migration of StudioPageHeader from the legacy package to the public @studio/components package is correct and consistent with the broader migration effort.


34-48: LGTM! API simplification using data attributes.

The removal of explicit color and variant props in favor of the data-color='neutral' attribute on the underlying NavLink is a cleaner approach that delegates styling to CSS and data attributes. The active state logic and navigation behavior are correctly preserved.

src/Designer/frontend/app-preview/src/views/LandingPage.tsx (1)

11-20: LGTM! Import migration is correctly applied.

The migration of StudioPageHeader to the public @studio/components package while keeping useMediaQuery in the legacy package follows the incremental migration strategy. The component usage remains unchanged, ensuring no behavioral impact.

src/Designer/frontend/dashboard/pages/PageLayout/DashboardHeader/DashboardHeader.tsx (2)

4-5: LGTM! Import consolidation is correctly implemented.

The migration of StudioAvatar and StudioPageHeader to the public @studio/components package while keeping useMediaQuery in the legacy package follows the incremental migration approach.


71-81: LGTM! API simplification is consistently applied.

The removal of ariaLabelTriggerButton, color, and variant props from StudioPageHeader.ProfileMenu is consistent with the broader API simplification effort. The component retains all essential functionality, and the small-screen handling with SmallHeaderMenu is preserved.

src/Designer/frontend/app-development/layout/PageHeader/PageHeader.tsx (2)

3-4: LGTM! Import migration is correctly implemented.

The migration of StudioPageHeader and StudioAvatar to the public @studio/components package while keeping useMediaQuery in the legacy package follows the incremental migration approach.


68-87: LGTM! Context and API updates are correctly applied.

The removal of variant from the context destructuring and the removal of ariaLabelTriggerButton, color, and variant props from StudioPageHeader.ProfileMenu are consistent with the API simplification. All essential functionality is preserved, including the small-screen handling.

src/Designer/frontend/app-development/layout/PageHeader/SubHeader/PreviewButton/PreviewButton.tsx (2)

5-6: LGTM! Appropriate incremental migration.

The migration correctly imports components from @studio/components while keeping useMediaQuery in the legacy package, following the incremental migration pattern.

Based on learnings.


26-30: The review comment is incorrect. The aria-label does reach the interactive element.

The HeaderLink component destructures className, renderLink, isBeta, and ...rest from its props, then creates a props object with { className, ...rest }. Since aria-label is not explicitly destructured, it's captured in ...rest. This props object (containing aria-label) is passed to the renderLink callback, which then spreads it into StudioLinkButton on line 30 via {...props}. The aria-label attribute correctly propagates through this props-forwarding pattern to the interactive element.

Likely an incorrect or invalid review comment.

src/Designer/frontend/libs/studio-components/src/components/StudioPageHeader/StudioPageHeaderLeft/DigdirLogoLink/DigdirLogoLink.tsx (1)

15-17: LGTM! Standard home link pattern.

Wrapping the logo in a StudioLink with href='/' is a standard UX pattern that makes the logo clickable and navigates to the home page. The existing accessibility features (role and title on the SVG) are preserved.

…er-with-the-new-component-and-remove-the-old-one
@JamalAlabdullah JamalAlabdullah changed the title 16650 migrate usage of legacy studiopageheader with the new component and remove the old one chore: 16650 migrate usage of legacy studiopageheader with the new component and remove the old one Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (f63ea9c) to head (a3c6e80).
⚠️ Report is 391 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16937      +/-   ##
==========================================
+ Coverage   96.19%   96.20%   +0.01%     
==========================================
  Files        2447     2391      -56     
  Lines       30790    30458     -332     
  Branches     3544     3510      -34     
==========================================
- Hits        29618    29302     -316     
+ Misses        864      851      -13     
+ Partials      308      305       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JamalAlabdullah JamalAlabdullah moved this to 🔎 In review in Team Altinn Studio Nov 26, 2025
@JamalAlabdullah JamalAlabdullah added the squad/utforming Issues that belongs to the named squad. label Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/app-preview Area: Related to test and preview of apps that are developed in Altinn Studio. area/dashboard Area: Related to the dashboard application area/resource-registry area/studio-root Area: Issues related to studio-root application area/version-control Area: Related to version control for files in apps. frontend skip-releasenotes Issues that do not make sense to list in our release notes solution/studio/designer squad/utforming Issues that belongs to the named squad.

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

Migrate usage of legacy StudioPageHeader with the new component and remove the old one

1 participant