Conversation
aaronleopold
left a comment
There was a problem hiding this comment.
Thank you for working on this, I reviewed the changes this morning and have some feedback
| #[graphql(default)] | ||
| links: Vec<FilterableArrangementEntityLink>, |
There was a problem hiding this comment.
OnDeck does not need links, there are a few others that make similar mistake (e.g., preexisting InProgressBooks). I do recall, although it was really some time ago, adding them for a future where there is a See all button but I think until that point it is simpler to remove until needed
| .home_arrangement | ||
| .clone() | ||
| .unwrap_or(Arrangement::default_home()) | ||
| .with_missing_home_sections() |
There was a problem hiding this comment.
I mentioned removing this earlier, so perhaps all existing ones still need to flow through new() or something in case they need cleaning
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Thanks for the detailed review, @aaronleopold! I've pushed updates addressing your feedback and merged the latest nightly changes. Whenever you have a chance, I'd appreciate another look. Happy to make any further adjustments! |
aaronleopold
left a comment
There was a problem hiding this comment.
Thanks for making those updates! I have one remaining point, but otherwise I think this looks good
| pub navigation_arrangement: Option<Json>, | ||
| #[sea_orm(column_type = "Json", nullable)] | ||
| #[graphql(skip)] | ||
| #[serde(default = "Model::default_home_arrangement")] | ||
| pub home_arrangement: Option<Arrangement>, | ||
| pub home_arrangement: Option<Json>, |
There was a problem hiding this comment.
Not sure I like this one, instead we could maybe manually implement FromJsonQueryResult with a safer parse? Otherwise this cuts a bit from a dx-perspective. I think a lot of the changes in this file go away if we do that, as well
There was a problem hiding this comment.
Thanks for the suggestion! Addressed in 9274ad7.
Both fields are back to Option<Arrangement>. The manual SeaORM JSON conversion treats unreadable stored configurations as absent, allowing home and navigation to use their respective defaults without losing other preferences. This removes the explicit JSON conversions from callers while preserving home section normalization.
SQLite tests cover valid and invalid configurations, preservation of other preferences, and recovery on the next save without modifying stored data during reads. Model, GraphQL, and server tests passed, along with formatting and schema checks.
The broader all-target Clippy check reports four existing lint errors on local Rust 1.98; I confirmed the same errors on the unchanged PR head.
설정 필드를 Option<Arrangement>로 복원하고 저장 JSON의 구조 오류를 DB 조회 단계에서 None으로 처리한다. 홈과 탐색 설정, 인증 사용자 경로의 수동 JSON 변환을 제거하고 각 기본값과 홈 섹션 정규화를 유지한다. SQLite 회귀 테스트로 설정 보존과 조회 후 저장 복구를 확인한다.
Description
Home page sections currently have a fixed order and cannot be hidden. This adds an editor under Preferences → Home page to show or hide the four existing sections, reorder them by dragging or keyboard, and save the layout per user. Reset restores the default order and visibility. When every section is hidden, the home page provides a link back to preferences.
This implements the home-section portion of #245.
updateHomeArrangementand apply the same normalization when reading saved home sections: keep the first supported occurrence of each section, preserve its order and visibility, and append missing sections as hidden.linksfields from the built-in home section configurations.The shared server API can support a future mobile implementation. This PR adds the web editor and updates its documentation.
LLM tooling assisted with this contribution.
Validation
modelsandgraphql, GraphQL schema consistency, and client generation passed.nightly: aligned the home test withreact-routerand added explicit hook return types to fix declaration generation.Ready?
nightlyand notmainStump Contributor License Agreement
By contributing to Stump, you agree that your contributions will be licensed under the following licenses (where applicable):