-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fix button saying server offline after it comes back. #3213
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
@MikesGlitch What changes were requested? I see no review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, I don't think you were able to see the comments because I didn't click the button 🤦♂️
style?: CSSProperties; | ||
color?: string; | ||
}; | ||
export function LoggedInUser({ | ||
hideIfNoServer, | ||
syncState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I should be able to do this there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so after looking into this area of the code, it definitely won't work.
This is making me rethink how that button works in general, and the approach used. Perhaps the button needs its own logic to determine the state instead of relying on other components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently working in the latest master so if we merge this branch we'd be breaking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, like I said it probably needs reworked.
👋 Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review. |
👋 Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review. |
👋 Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review. |
WalkthroughThe pull request introduces modifications to the Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (1)
Additional comments not posted (5)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
upcoming-release-notes/3213.md (1)
1-6
: Expand the release notes with more details.The release notes accurately describe the bug fix at a high level. However, consider adding more details based on the information provided in the PR objectives and AI summary:
- Mention that this is an alternate solution to the issue referenced in [Bug]: says "server offline" when it actually came back #3128 and 🐛(titlebar) update server status on sync #3164.
- Briefly describe the changes made to
LoggedInUser
,Titlebar
andSyncButton
components to address the bug.This will provide more context and technical details about the bug fix to the users reading the release notes.
Tools
LanguageTool
[uncategorized] ~6-~6: You might be missing the article “the” here.
Context: ...ory: Bugfix authors: [psybers] --- Fix button saying server offline after it comes ba...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- packages/desktop-client/src/components/LoggedInUser.tsx (5 hunks)
- packages/desktop-client/src/components/Titlebar.tsx (4 hunks)
- upcoming-release-notes/3213.md (1 hunks)
Additional context used
LanguageTool
upcoming-release-notes/3213.md
[uncategorized] ~6-~6: You might be missing the article “the” here.
Context: ...ory: Bugfix authors: [psybers] --- Fix button saying server offline after it comes ba...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
Additional comments not posted (9)
packages/desktop-client/src/components/LoggedInUser.tsx (4)
16-16
: LGTM!The addition of the
syncState
prop to theLoggedInUserProps
type is a good improvement. It allows the component to receive synchronization state information directly, replacing the previous reliance on user data from the Redux store. The possible values forsyncState
cover various synchronization states, providing more granular control over the component's behavior.
22-22
: LGTM!The
LoggedInUser
component signature has been updated to accept the newsyncState
prop, which is consistent with the modification made to theLoggedInUserProps
type.
63-73
: LGTM!The refactoring of the
serverMessage
function into a memoized value usinguseMemo
is a good optimization. It ensures that the message is recalculated only whenserverUrl
orsyncState
changes, improving performance.The updated logic within the function accurately represents the current synchronization state based on the
syncState
prop, providing a more reliable server status message.The memoized value correctly depends on
serverUrl
andsyncState
, ensuring that it updates when either of these values change.
102-102
: LGTM!The adjustments made to the rendering logic for the button and popover items, utilizing the new
syncState
prop, enhance the component's responsiveness to changes in server connectivity and user synchronization status.Using the
serverMessage
memoized value for the button text ensures that the displayed message accurately reflects the current state, providing a better user experience.Conditionally rendering the popover item for changing the password based on
syncState
improves the user experience by showing the option only when appropriate.Also applies to: 114-117
packages/desktop-client/src/components/Titlebar.tsx (5)
99-102
: LGTM!The addition of the
syncState
andsetSyncState
props to theSyncButtonProps
type is a good change. It allows the sync state to be managed externally and passed into theSyncButton
component, enabling better control and communication of sync states between theSyncButton
and its parent component.
105-110
: LGTM!The
SyncButton
component is correctly updated to accept the newsyncState
andsetSyncState
props, which are used to manage the sync state externally. The component signature looks good.
272-274
: LGTM!The
Titlebar
component now maintains its ownsyncState
using theuseState
hook, which is initialized tonull
. This change allows theTitlebar
to control the sync state and pass it down to theSyncButton
component, improving the state management of the sync functionality.
345-351
: LGTM!The conditional rendering of the
SyncButton
based on the presence of aserverURL
is a good practice. It ensures that the button is not displayed when there's no server connection. Additionally, thesyncState
andsetSyncState
props are correctly passed from theTitlebar
to theSyncButton
, enabling theTitlebar
to control the sync state.
352-352
: Verify the usage of thesyncState
prop in theLoggedInUser
component.The
LoggedInUser
component now receives thesyncState
prop, indicating a potential dependency on the sync status for rendering or functionality. Please ensure that theLoggedInUser
component correctly handles thesyncState
prop and that it's being used for a valid purpose.Run the following script to verify the usage of the
syncState
prop within theLoggedInUser
component:Verification successful
The
syncState
prop is correctly utilized in theLoggedInUser
component.After verifying the usage of the
syncState
prop within theLoggedInUser
component, I can confirm that it is being used appropriately and for valid purposes:
- It's properly typed in the component's props.
- It's used to determine the server status message.
- It's included in the dependency array of a
useMemo
hook for proper reactivity.- It's used to conditionally render menu items based on the sync state.
These usages align with the expected functionality of managing and displaying the sync state within the user interface.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `syncState` prop within the `LoggedInUser` component. # Test: Search for the usage of the `syncState` prop. Expect: Relevant usage within the component. rg --type typescript -A 5 $'syncState' $(fd LoggedInUser.tsx)Length of output: 151
Script:
#!/bin/bash # Description: Verify the usage of the `syncState` prop within the LoggedInUser component. # Display the contents of LoggedInUser.tsx and search for syncState cat packages/desktop-client/src/components/LoggedInUser.tsx | grep -n -C 5 "syncState"Length of output: 1308
This is an alternate fix for #3128. See #3164 for another approach.