Skip to content

Conversation

@fritzSF
Copy link
Collaborator

@fritzSF fritzSF commented Nov 4, 2025

Note: Component names are temporary, only for testing

@fritzSF fritzSF added the WIP Work in progress label Nov 4, 2025
@fritzSF fritzSF requested review from eos87 and thecalcc November 4, 2025 18:46
@thecalcc thecalcc requested a review from Copilot November 7, 2025 10:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new form layout system with multiple reusable components and provides a playground for testing form patterns. The changes include new React components for flexible form layouts, comprehensive SCSS styling, code quality improvements in existing stylesheets, and documentation corrections.

  • Adds new FormLayout, FormGroupNew, and FormGroupItemNew components to support flexible grid-based and flex-based form layouts
  • Introduces FormPlayground demonstrating two different form patterns (multiple form groups vs single form group)
  • Refactors searchbar styles to use CSS variables and improves code formatting consistency

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
examples/pages/playgrounds/react-playgrounds/FormPlayground.tsx New playground component showcasing form layout patterns with various input combinations
examples/pages/playgrounds/react-playgrounds/Index.tsx Exports the new FormPlayground component
examples/index.js Registers the FormPlayground component in the routing configuration
app-typescript/components/Form/FormLayout.tsx New component providing configurable form layout wrapper with fieldset support
app-typescript/components/Form/FormGroupNew.tsx New component for grouping form items with optional grid layout
app-typescript/components/Form/FormGroupItemNew.tsx New component for individual form items with responsive column spanning
app-typescript/components/Form/index.tsx Exports the new form components
app/styles/form-elements/_forms-general.scss Adds comprehensive styling for new form layout system with responsive grid support
app/styles/components/_sd-searchbar.scss Refactors to use CSS variables and improves formatting consistency
app/styles/_reboot.scss Minor comment formatting improvement
examples/pages/components/utilities/TextUtilities.tsx Fixes CSS variable name in documentation from --text-size-x-small to --text-size-xx-small

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


let options3 = [
{
value: {name: 'Norvegian'},
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Typo in comment: "Norvegian" should be "Norwegian"

Suggested change
value: {name: 'Norvegian'},
value: {name: 'Norwegian'},

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +62
changeStatus(item: any, status: string) {
if (item.status.includes(status)) {
item.status.splice(item.status.indexOf(status), 1);
} else {
item.status.push(status);
}
}

Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The changeStatus method is defined but never used in the component. Consider removing it if it's not needed, or implementing its functionality if it was intended to be used.

Suggested change
changeStatus(item: any, status: string) {
if (item.status.includes(status)) {
item.status.splice(item.status.indexOf(status), 1);
} else {
item.status.push(status);
}
}

Copilot uses AI. Check for mistakes.
children: React.ReactNode;
spaces?: 'compact' | 'standard' | 'relaxed'; // defaults to 'standard'
marginBottom?: '0' | '1' | '2' | '3' | '4'; // multipliers of 8px (base increment); defaults to '2' (16px)
legend?: string; // provides anoptional legend for the form layout/fieldset (can be used to group items together)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Typo in comment: "anoptional" should be "an optional"

Suggested change
legend?: string; // provides anoptional legend for the form layout/fieldset (can be used to group items together)
legend?: string; // provides an optional legend for the form layout/fieldset (can be used to group items together)

Copilot uses AI. Check for mistakes.
Comment on lines +405 to +411
.form__group-new--has_row-label {
.form__group-new__wrapper {
display: flex;
flex-direction: column;
width: 100%;
}
}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Duplicate CSS rule block. Lines 397-403 and 405-411 define the exact same .form__group-new--has_row-label .form__group-new__wrapper rules. One of these blocks should be removed.

Suggested change
.form__group-new--has_row-label {
.form__group-new__wrapper {
display: flex;
flex-direction: column;
width: 100%;
}
}

Copilot uses AI. Check for mistakes.
Comment on lines +542 to +546
.form-group-new-item--auto-width {
flex-grow: 0;
min-width: 0;
flex-basis: auto;
}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Duplicate CSS rule. Lines 542-546 define .form-group-new-item--auto-width with the same properties already defined within .form-group-new-item at lines 516-520. This duplication should be removed.

Suggested change
.form-group-new-item--auto-width {
flex-grow: 0;
min-width: 0;
flex-basis: auto;
}

Copilot uses AI. Check for mistakes.
--form-group-col-gap: var(--gap-3);
}
}
@container form-container (width<= 500px) {
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Missing space after <= operator. Should be (width <= 500px) for consistency with line 547.

Suggested change
@container form-container (width<= 500px) {
@container form-container (width <= 500px) {

Copilot uses AI. Check for mistakes.
@thecalcc
Copy link
Collaborator

thecalcc commented Nov 7, 2025

@fritzSF I have a bunch of technical comments on code style, etc. Do you want me to just make a commit to address them?

@fritzSF
Copy link
Collaborator Author

fritzSF commented Nov 7, 2025

@fritzSF I have a bunch of technical comments on code style, etc. Do you want me to just make a commit to address them?

@thecalcc Yes, please go ahead! The Copilot-generated review comments aren't particularly helpful at this stage. I see this more as a proof of concept, the CSS needs cleanup and optimization, the component needs renaming, and we'll need proper documentation.
My main focus right now is evaluating whether this logic can be applied broadly across the codebase in Superdesk and identifying what improvements or changes would be needed to get there. Style fixes are welcome, but they're not critical at this point.

@eos87
Copy link

eos87 commented Nov 11, 2025

It looks good to me. As Konstantin mentioned, it needs some polishing but I understand it is a work in progress. What would be the next step @fritzSF? is there anything you would need from our side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants