Drop maximum_name_length; remove How-To-Use from Settings#35
Merged
dadachi merged 1 commit intosubstrate-v2from Apr 27, 2026
Merged
Drop maximum_name_length; remove How-To-Use from Settings#35dadachi merged 1 commit intosubstrate-v2from
dadachi merged 1 commit intosubstrate-v2from
Conversation
Two unrelated substrate-v2 cleanups bundled here.
## 1. Drop maximum_name_length from permissions; move to NatConstants
The server no longer sends maximum_name_length in /shopkeeper/permissions;
the client already tolerated its absence via a default. Promote the value
to a constant and drop the dead plumbing.
### Stop reading maximum_name_length from /shopkeeper/permissions
- Meta: drop the @SerialName("maximum_name_length") field.
- Permissions: drop getMaximumNameLength() helper.
- UserData: drop maximumNameLength field.
- user_preferences.proto: reserved 23 (was maximum_name_length) so the
wire number isn't reused.
- NatPreferencesDataSource: drop the read in the userData mapping, the
write in setPermissions, and the getMaximumNameLength() flow.
- LoginRepository (interface + impl + DemoLoginRepository +
TestLoginRepository): drop getMaximumNameLength().
### Move maximumNameLength to NatConstants
- NatConstants: add MAXIMUM_ITEM_TAG_NAME_LENGTH = 100.
- ItemTagCreateViewModel + ItemTagEditViewModel:
- UiState.maximumNameLength default now reads the constant.
- Drop the loginRepository constructor param — it was only used for
getMaximumNameLength().
- ItemTagCreateViewModel.reload() simplifies to a state reset.
- ItemTagEditViewModel.fetchData() drops the combine() pairing the
item-tag flow with the maximum-name-length flow.
- Tests rewritten to drop the now-removed loginRepository wiring and
the dead .copy(maximumNameLength = 100) calls; new
maximumNameLength_matchesConstant tests assert against the
NatConstants value (100).
## 2. Remove "How To Use" entry from Settings
Drop the SettingsView list item linking to myturntag.com/how — a
queue-product help page that no longer matches the substrate-v2
generic CRUD app surface.
The string resource (R.string.how_to_use), the
NatConstants.HOW_TO_USE_URL constant, and the OnboardingView call site
are left in place because they are still wired and may be repurposed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
dadachi
added a commit
that referenced
this pull request
Apr 27, 2026
Mirror the ItemTag pattern (PR #35) for Shop. Server has no caps on Shop name/description; this is a client-only UX guard. ### Changes - NatConstants: MAXIMUM_SHOP_NAME_LENGTH = 100, MAXIMUM_SHOP_DESCRIPTION_LENGTH = 1_000. - strings.xml: new shop_name_is_invalid, shop_description_is_invalid, shop_name_help, shop_description_help (parametric). - ShopCreateViewModel + ShopBasicSettingsViewModel: - UiState gains maximumNameLength / maximumDescriptionLength (defaulted to the constants). - hasInvalidData() splits into hasInvalidDataName() + hasInvalidDataDescription(); the parent now ORs both. - updateName() / updateDescription() reject input over the cap (mirrors the existing ItemTagCreateViewModel / ItemTagEditViewModel Android pattern). - ShopCreateView + ShopBasicSettingsView: switch supportingText to the two-line layout (always-visible help + conditional red "is invalid" line), matching ItemTagCreateView / ItemTagEditView. Description switches to heightIn(min=120) + minLines=4. - Tests: maximumNameLength_matchesConstant / maximumDescriptionLength_matchesConstant, boundary tests at 100 / 101 / 1000 / 1001 chars on both ShopCreateViewModelTest and ShopBasicSettingsViewModelTest. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Mirrors NativeAppTemplate-Android PR #47. Two unrelated substrate-v2 cleanups bundled here.
1. Drop
maximum_name_lengthfrom permissions; move toNatConstantsAndroid port of NativeAppTemplate-iOS#59. The server no longer sends
maximum_name_lengthin/shopkeeper/permissions; the client already tolerated its absence via a default. Promote the value to a constant and drop the dead plumbing.Stop reading
maximum_name_lengthfrom/shopkeeper/permissionsMeta: drop the@SerialName("maximum_name_length")field.Permissions: dropgetMaximumNameLength()helper.UserData: dropmaximumNameLengthfield.user_preferences.proto:reserved 23(wasmaximum_name_length) so the wire number isn't reused.NatPreferencesDataSource: drop the read in theuserDatamapping, the write insetPermissions, and thegetMaximumNameLength()flow.LoginRepository(interface + impl +DemoLoginRepository+TestLoginRepository): dropgetMaximumNameLength().Move
maximumNameLengthtoNatConstantsNatConstants: addMAXIMUM_ITEM_TAG_NAME_LENGTH = 100.ItemTagCreateViewModel+ItemTagEditViewModel:UiState.maximumNameLengthdefault now reads the constant.loginRepositoryconstructor param — it was only used forgetMaximumNameLength().ItemTagCreateViewModel.reload()simplifies to a state reset.ItemTagEditViewModel.fetchData()drops thecombine()pairing the item-tag flow with the maximum-name-length flow.loginRepositorywiring and the dead.copy(maximumNameLength = 100)calls; newmaximumNameLength_matchesConstanttests assert against theNatConstantsvalue (100).Backend dependency
Server may stop emitting
maximum_name_lengthin/shopkeeper/permissionsmeta (the client no longer reads it).2. Remove "How To Use" entry from Settings
The Settings screen carried a "How To Use" list item linking to
myturntag.com/how— a queue-product help page that no longer matches the substrate-v2 generic CRUD app surface. Drop just theSettingsViewlist item.The string resource (
R.string.how_to_use), theNatConstants.HOW_TO_USE_URLconstant, and theOnboardingViewcall site are left in place because they are still wired and may be repurposed.Test plan
./gradlew test→ BUILD SUCCESSFUL./gradlew assembleDebug→ BUILD SUCCESSFUL./gradlew spotlessCheck→ BUILD SUCCESSFUL./gradlew lint→ BUILD SUCCESSFUL🤖 Generated with Claude Code