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

fix: Explicit width on create code list dialog #14799

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Feb 25, 2025

Description

Made the create code list dialog always fill the same amount of the window width.

Current:
image

This branch:
image

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)

Summary by CodeRabbit

  • Style
    • Updated modal styling to use a fixed width of 80% viewport width, allowing a broader display on larger screens.

Copy link
Contributor

coderabbitai bot commented Feb 25, 2025

📝 Walkthrough

Walkthrough

This change updates the CSS for a modal in the CodeList component. The width of the modal is modified by replacing the original min(80vw, 64rem) with a fixed 80vw, effectively removing the maximum width constraint. No alterations were made to the declarations of exported or public entities.

Changes

File Summary
frontend/libs/.../CreateNewCodeListModal.module.css Updated the .createNewCodeListModal[open] rule: replaced min(80vw, 64rem) with 80vw to remove the maximum width limitation.

Suggested labels

area/ui-editor, skip-manual-testing, skip-documentation

Suggested reviewers

  • github-actions
  • Jondyr

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed7f337 and 4f93617.

📒 Files selected for processing (1)
  • frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CreateNewCodeListModal/CreateNewCodeListModal.module.css (1 hunks)
🔇 Additional comments (1)
frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CreateNewCodeListModal/CreateNewCodeListModal.module.css (1)

2-3: Uniform Modal Width Achieved Effectively

The change to set width: 80vw; explicitly ensures that the dialog occupies 80% of the viewport width regardless of screen size, which directly addresses the PR objective of consistent dialog width. Note that by removing the previous maximum constraint (min(80vw, 64rem)), you may encounter layout concerns on very wide screens. It would be beneficial to verify that this behavior meets the intended design on all target devices.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added solution/studio/designer Issues related to the Altinn Studio Designer solution. frontend labels Feb 25, 2025
@TomasEng TomasEng changed the title fix: Explicit size on create code list dialog fix: Explicit width on create code list dialog Feb 25, 2025
@TomasEng TomasEng added area/content-library Area: Related to library for shared resources team/studio-domain1 labels Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.77%. Comparing base (ed7f337) to head (4f93617).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14799   +/-   ##
=======================================
  Coverage   95.77%   95.77%           
=======================================
  Files        1919     1919           
  Lines       25043    25043           
  Branches     2859     2859           
=======================================
  Hits        23984    23984           
  Misses        799      799           
  Partials      260      260           

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

@TomasEng TomasEng marked this pull request as ready for review February 25, 2025 11:33
@Konrad-Simso Konrad-Simso self-assigned this Feb 26, 2025
Copy link
Contributor

@Konrad-Simso Konrad-Simso left a comment

Choose a reason for hiding this comment

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

With 80vw we will be supporting at minimum 1600 x 900 resolution. There are a few laptops with a lower resolution, but not many.

If a user has a laptop with 1366 x 768 they will not see the remove button without scrolling, unless the width is set to 85vw

85vw looks like this on 1920 x 1080:

image

@TomasEng
Copy link
Contributor Author

Thanks for testing, @Konrad-Simso!

At some point, the scrollbar will appear regardless of which value we choose for the width. This does not only depend on the window size, but also the user's font size settings, since the width of the text fields is defined with rem values.

I chose 80vw because this was the value that was already present in the file, and we use the same value on the settings modal. (Ideally we should have a common variable for this, but this is an isolated package and we still need to decide how to store such variables.) It also represents a simple fraction: 4/5.

I suggest that we keep this simple and consistent with 80vw until user testing reveals that we need a more specific value.

@TomasEng TomasEng merged commit 8bd3870 into main Feb 26, 2025
16 checks passed
@TomasEng TomasEng deleted the fix-create-code-list-modal-size branch February 26, 2025 11:23
@TomasEng TomasEng removed their assignment Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/content-library Area: Related to library for shared resources frontend solution/studio/designer Issues related to the Altinn Studio Designer solution. team/studio-domain1
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants