Merge Changes into Main from Canary (v3.5.0-5abefb29)#287
Open
github-actions[bot] wants to merge 273 commits into
Open
Merge Changes into Main from Canary (v3.5.0-5abefb29)#287github-actions[bot] wants to merge 273 commits into
github-actions[bot] wants to merge 273 commits into
Conversation
The reason for this type assertion is tied to the way zod@4 schemas type their input. When a schema uses the `.default` operand the input for that property / schema is typed as `T | undefined`. Since the schema used in the `useRHF` hook is also generic it may or may not use `.default` operands, which types the input as unknown which does not satisfy the `FieldValues` type. This type assertion basically tells the resolver that the schema-input conforms with the `FieldValues` type, thus the input type does not include `undefined`.
The reason for this change is that the `error` property returned by the `safeParse` function no longer holds the `formErrors` property. By using the new `.issues` property and slightly modifying the retrieval of the respective message this logic continues to work as expected.
The reason for this is that the `QuestionSchema` uses a `.default` operand on the root level, which causes the zod-schema input-type to be typed as `T | undefined` which violates the `FieldValues` type. One way of resolving this issue would be to remove `default` operand or by telling the resolver that the schema-input type is just `T`. In this case `Question`.
From zod@3 to zod@4 the default error-message for the `positive` operand has slightly changed from "Number must be greater than 0" to "Too small: expected Number to be >0". This commit explicitly defines the error-message in this case, to ensure the same error message is used.
Previously the instantiation of enum-values could have failed when the `values` array was empty as the randomIndex would have evaluated to `NaN`. At the same time the keys of the enum-entries were used instead of their values. While the key usually matches the value it must not always be the case.
Previously the `stripEffects` utility function re-applied the default-value which can be either a static value or a function, only as a value. Meaning that when the default-value would have been a function the `stripEffects` utility function would have re-applied the default-value with the result of the function instead of the function. By essentially re-applying the default-value of the unstripped-schema this issue should be resolved and the behavior should be modified.
Previously the `stripEffects` utility function with the strip option set to `effects-only` did not strip nested effects within an array. Note that, while this commits adds the stripping of effects it also removes all other checks, such as min, max, refinements which need to be re-applied in the future.
The reason for this commit that the `stripZodDefault` utility function would have removed the input of the pipe when the output was anything else than a transform. This commit basically re-applies the pipe but calls the strip-function on both the input and output. When the output of the pipe is undefined / not found it will only return the input of the pipe.
Previously the `stripZodDefault` function did not re-apply the `readonly` and `nonoptional` operand to a given property / schema which could modify the schema validation outcome.
The reason for this is that the output of a pipe that basically wraps e.g. an object in a transform operand does not properly unwrap, resulting in undefined. Then again. Since the stripping of a transform effect yields undefined an error will be thrown along the way when the pipe is re-applied with undefined instead of the transform-effect. Thus, the `stripZodDefault` function will not be called on piped transform effects but instead the output-transform will be re-used.
This way logs are printed to the console when checks are removed from an array, to simplify debugging down the line.
This component will be used to allow users to search for a check based on its share-token.
This way users are shown the available options (start-practice, start examination) after entering a respective share-token.
This page allows users to enter a check's share-token to start e.g. to practice or an examination attempt.
This way the logic that checks the availability of examinations and practice does not update state when the useEffect has already exit. This means that on frequent statement changes and >> useEffect calls the intermediate calls are aborted and the result of fetching the respective check will not trigger a state-change. This eliminates a possible race-condition.
This way the loading (parsing) indicator is shown slightly longer even if the state changes immediately. This allows users to easily scan and process the loading indicator.
This way users can set this argument to true to show a error icon along side the error-message.
Instead of manually building a card that wraps the share-token input component the shadcn card component is used to achieve a more unified appearance.
This new component uses a react-hook-form instance to simplify validation and error message display. At the same time it allows for extension through the Form context.
This component is used to wrap multiple share-token related inputs and to provide context values to said components. Aside from the rhf form properties it also holds a `isDone` state that is used to determine whether the availability retrieval is finished.
This component basically externalizes the rendering of share-token options (practice, examination) into a separate component. It retrieves a given check once the input-form is valid and sets form-errors when the retrieval is not succesful.
The reason for this change is that previously the root-error and parsing-loading indicator were wrapped by separate parent containers. This meant that each container introduced a gap in the flexbox, which caused alignment issues when one or the other or both were shown. By combining them in one wrapper and replacing the gap with a margin-top (to eliminate sudden layout shifts when elements disappear) the animation UX is significantly improved.
The reason for this change is that when user cleared the share-token input ("") the schema was still not satisfied, thus the form remained inValid. This meant that when the user began to start typing the form-error was immediately shown. By clearing the field-error when the user clears the input resets the error-delay too. This means that this way users are shown errors with the given form-errorDelay after clearing their input.
This massive component that had too many responsibilities was externalized into the `ShareTokenInput` and `ShareTokenOptions` component. Thus, this component is no longer needed.
Author
|
🎉 This PR is included in version 4.0.0-canary.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This component may be used to show the contents associated to a given check, e.g. within the `OverviewSection` when creating a new course.
This new page is going to show the contents of a given course so that users can familiarize themselves with the contents associated to a given course.
This way users can view the course contents associated to a given course.
Separated the rendering of the `ContentSection` into subcomponents to improve readability and maintainability.
This way the `ContentSection` now mimics the existing `QuetionsSection`. This means it shows the contents in a list instead of a grid. The reason for this change is that this eliminates sudden changes in the app's layout and also makes it easier to re-use this section in the `OverviewSection`.
By redesigning the `ContentSection`'s layout it can be easily re-used in the `OverviewSection` for users to review their changes.
This way the amount of contents associated to a given course are displayed when discovering new or checks a user contributes to.
This component is used to manage state about the content currently shown to the user and to switch between contents.
This component is used to switch between the contents in the `/contents/[courseId]` page.
This component renders the currently selected course content in a readOnly `RichtTextEditor`.
This component is rendered within the course contents page to define custom breadcrumbs for this page.
These new button components allow users to continue to the next content in line or go back to the previous content.
This way the navigation buttons are in the same "column" as the `RichTextEditor` which is visually more appealing.
This way the buttons show a label on top of the content title ("previous", "next") to indicate it as an call-to-action.
This way the classes of the container wrapping the `RichtTextEditor` can be easily adjusted. This is especially useful to dynamically update the max-height constraint when needed.
This way users on mobile screens can use the navigation buttons below the editor to navigate between contents. The reason for this is that displaying the navigation next to the editor on small screens leads to both elements not being properly visible. Similarly, showing the navigation above or below the editor reduces the overall UX and appearance.
This reverts commit 81a8cdc.
Previously, if users would navigate to a course page where the respective check has no contents, it would try to display contents that don't exist. This meant that the page looked kind of broken. By adding a safeguard that redirects users back to where they came from or to the courses page when the a course has no contents eliminates this edge-case.
The reason for this change is that when the index retrieval was unsuccessful the button previously would have switched to the invalid index (-1). Now the button is disabled when index retrieval is unsuccessful, thus when switching is not possible.
Added a missing translation in the `EmptyCourseContentBody` subcomponent.
The reason for this change is that in the wrapping div element that is the direct child of the DialogTrigger that in turn renders a button is considered the trigger. This would mean that the disabled state between button and trigger could be out-of-sync. However, the div wrapper was previously also consumed by the trigger, because it wasn't rendered. By moving the wrapping div outside the trigger, the potential issue is resolved anyhow.
Author
|
🎉 This PR is included in version 4.0.0-canary.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by the Auto-Create-PR-Canary workflow to merge changes from the canary branch into main. These changes are based on v3.5.0 and the latest commit on main (5abefb2).
It merges the changes made in #283, #286, #288, #289, #290, #291, #292, #294, #295 into the main branch.
Merged Pull requests:
knowledgeCheckterm tocourse#288