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

Output settings form to react #5299

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Conversation

michelinewu
Copy link
Contributor

No description provided.

Copy link

bundlemon bot commented Feb 7, 2025

BundleMon

Files updated (1)
Status Path Size Limits
renderer.(hash).js
7.09MB (+11.07KB +0.15%) -
Unchanged files (3)
Status Path Size Limits
vendors~renderer.(hash).js
4.67MB -
updater.js
115.29KB -
guest-api.js
40.19KB -

Total files change +11.07KB +0.09%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@michelinewu michelinewu marked this pull request as ready for review February 12, 2025 22:33
options?: Omit<IObsListOption<unknown>, 'description'>[];
}

const ObsInputListCustomInput = forwardRef<{}, IObsInputListCustomInputProps>((p, ref) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm im not sure this component should be named so generically when it has a lot of code dedicated to handling custom resolutions specifically

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed

/**
* @remark Note: The following is a copy of the shared component `TextInput` but with the reference forwarded.
* This is to allow form validation to work correctly.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if it would make more sense to just forward the refs on these shared components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to do that, I have to convert the shared component into a forwardRef. Because the TextInput and NumberInput shared components are used in so many other places, there is a risk that this could effect another form. So in order to do this, we'd have to test every form in the app, which we can do but would be a really large task.

label: $t(tab),
key: tab,
}));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason to restructure the props and format them here instead of just doing this formatting before passing in the tabs under the data prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how it was done in the vue component.


const type = settingsFormData[0].parameters[0].currentValue === 'Simple' ? 'collapsible' : 'tabs';

return <ObsGenericSettingsForm type={type as IObsFormType} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at how light this component is i wonder if it would make more sense to do more of the output settings specific layout handling here with the tabs and collapsible instead of in ObsGenericSettingsForm, it feels a bit weird to me to put a lot of things specific to one settings page in a generic component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using this generic settings form and passing in the backend settings all at once means that the forms will automatically update on the frontend. This will be less frontend maintenance going forward when adding/updating features with settings because all we will need to do is update the realm and the fields will adjust accordingly. Moreover, adding form types to the generic settings form enables the flexibility with form layout without requiring a lot of work on the frontend since all that is needed is to pass in the type. That being said, I will refactor the ObsTabbedFormGroup to be less output settings specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants