Skip to content

feat: add experimental workspace parameters page for dynamic params #17841

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
merged 7 commits into from
May 21, 2025

Conversation

jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented May 14, 2025

Screenshot 2025-05-20 at 22 26 40

@jaaydenh jaaydenh self-assigned this May 14, 2025
@jaaydenh jaaydenh force-pushed the jaaydenh/dynamic-params-workspace-settings branch from 2d8b95a to 0c7f4c1 Compare May 19, 2025 22:49
@jaaydenh jaaydenh requested a review from aslilac May 20, 2025 21:27
@jaaydenh jaaydenh marked this pull request as ready for review May 20, 2025 21:27
Copy link
Member

Choose a reason for hiding this comment

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

this isn't a very general purpose hook. could we put this in modules/workspaces or something instead?

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 hook will eventually be used a many different places, TemplateEmbedPage, WorkspaceSettingsPage, CreateWorkspacePage, UpdateBuildParametersDialog, BuildParametersPopover, WorkspaceParametersForm. Its not general purpose but it also doesn't feel like it should be buried in a subfolder. Maybe we don't currently have a good place for things like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to modules/hooks, modules are the place to gather all coder business logic that is not in pages so seems like the best place to put coder specific non-general purpose hooks

Comment on lines 41 to 47
newParameterValues.some(
(p) =>
!currentFormValues.find(
(formValue) =>
formValue.name === p.name && formValue.value === p.value,
),
);
Copy link
Member

Choose a reason for hiding this comment

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

this is O(n^2), but could pretty easily be rewritten to be O(n) using Map.groupBy or something similar

I guess it was already like this tho 🤷‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call out, I can improve.

@jaaydenh jaaydenh merged commit cb7ce18 into main May 21, 2025
34 checks passed
@jaaydenh jaaydenh deleted the jaaydenh/dynamic-params-workspace-settings branch May 21, 2025 17:48
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants