Refactor FXIOS-15349 [Technical Debt] [Redux] Use @Copyable macro for TabPeekState#34744
Refactor FXIOS-15349 [Technical Debt] [Redux] Use @Copyable macro for TabPeekState#34744hkarmoush wants to merge 1 commit into
Conversation
PARAIPAN9
left a comment
There was a problem hiding this comment.
Thanks @hkarmoush for your contribution. There is one important change to make in order for the project to build.
|
|
||
| @Copyable | ||
| struct TabPeekState: ScreenState { | ||
| let showAddToBookmarks: Bool |
There was a problem hiding this comment.
From the build errors I believe we need to add let windowUUID: WindowUUID above let showAddToBookmarks: Bool.
| .copy(previewAccessibilityLabel: tabPeekModel.accessiblityLabel) | ||
| .copy(screenshot: tabPeekModel.screenshot) | ||
| default: | ||
| return state |
There was a problem hiding this comment.
Shouldn't we use here: defaultState(from state:_ )? CC: @ih-codes.
There was a problem hiding this comment.
Yes, good catch @PARAIPAN9, it should. 👀 Also on the two guard return lines above. But that can be in a separate PR, since it's not related to adding @Copyable. So I don't think @hkarmoush needs to worry about that here.
1f4838f to
ac60483
Compare
|
@hkarmoush , everything's ok, we just need to address this to make sure the project builds without errors: #34744 (comment) |
📜 Tickets
Jira ticket
Github issue
💡 Description
Migrates
TabPeekState(Redux state) to use the@Copyablemacro from theModifiedCopypackage, replacing the reducer's manual full-struct reconstruction with chained.copy(property:)calls. This follows the same pattern already used by other Redux states in the codebase (e.g.SearchBarState,HomepageState).Pure technical-debt refactor — no behavior change, no public API change.
showCloseTabis intentionally left out of the.copy()chain since the existing reducer never updates it (always stays at its defaulttrue); confirmed viaTabPeekState(grep that no call site ever constructs it with a non-default value, so this is behavior-identical to before.TabPeekStateTests.swiftis unmodified.🎥 Demos
N/A — no UI or behavior change.
📝 Checklist
xcodebuild testlocally (no iOS Simulator runtimes installed in this environment); relying on CI to verifyTabPeekStateTests(5 existing tests) still pass unmodified