Improve UX for configuring Text type DB settings #1118
Labels
affects: ux
Related to user experience
type: enhancement
New feature or request
work: frontend
Related to frontend code in the mathesar_ui directory
Milestone
Context
In #1080 we added support for the text type, but today @pavish @kgodey and I identified some behavior that requires UX adjustments. This ticket lays out more specific specs for the UI to configure database type for the Mathesar Text type.
Background
The following Postgres types all map to the "Text" Mathesar type. (Reference.)
TEXT
VARCHAR(#)
(with a specific length set)VARCHAR
(without a specific length set)CHAR(#)
(with a specific length set)Specs
For a column having a Mathesar Type of "Text"...
The UI can configure the postgres type to either be (A) or (B) -- but not (C) or (D).
For a new text column, the default configuration is (A).
For (A), the UI remains as it already is:
For (B), the UI is:
After toggling "Restrict Field Size" to true, the default "Field Size Limit" is set to 255. "Field Size Limit" Is required -- if the user sets it to 0 or an empty value, the form is considered invalid and the save button is disabled.
If the column type has been configured outside of Mathesar to be (C), then the form will load as
This allows the user to transition the state from (C) to (A) or (B) by adjusting the form. It also allow the user to preserve the state as (C) by closing the form.
If the column has been configured outside of Mathesar to be (D) (a case we're expecting to be uncommon), then the UI will be:
Note that in this case the user will not be able to transition the column from (D) to (A) or (B). This column type is considered unsupported for now. We can display the data in it, and we can allow the user to edit the data, although there will be padding spaces in the data which is fine. But we don't need to provide a UI that allows the user to switch the column type to (A) or (B).
The text was updated successfully, but these errors were encountered: