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

Refactor Config #1547

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

CannonLock
Copy link
Contributor

@CannonLock CannonLock commented Aug 8, 2024

  • Refactor the rendering of config inputs so that they come from a list rather then recursing through a tree. This allows use to rerender one of the inputs without rerendering them all.
  • Use the server config as directly as possible. All valid inputs are translated directly to a patch that gets merged with original configuration. Some inputs have a validation buffer where only valid values are allowed to update the config. ( Can't update a int field to string) All object fields are updated in the same way, but the buffer is a entire object to ensure validity before patch creation.
  • Simplify the object inputs to use the same model type. Now each new field uses one state value that is the type of the object to be updated and that state is submitted when editing is complete.
  • Initial render on server side with the metadata so that you can see all the fields right away, even if the data is still loading from the api endpoints. This will be especially convenient when we get client side routing working as there will be 0 load when toggling to the config page.
  • Update the api to drop value type. That information is duplicative as I grab it from the metadata anyways.

- Change from recursive config inputs so all inputs don't remount on input change ( This is particularly brutal on text fields )
- Power everything directly from the server config which is pulled at a interval to keep things fresh. Now changes happening well you edit are reflected almost instantly in your display.
- Simplify the object inputs to use the same model. This adds some rendering overhead for a lot of code reduction.
- Client pages needed 'use client' directive
@CannonLock CannonLock marked this pull request as ready for review August 9, 2024 20:29
@CannonLock CannonLock linked an issue Sep 9, 2024 that may be closed by this pull request
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.

Issue when removing a string from a stringSlice in Config UI
1 participant