Import export study#3962
Conversation
📝 WalkthroughWalkthroughThis PR refactors the network modifications export from node-level to study-level. The ChangesStudy-level Network Modifications Export
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/network-modification-tree-pane.jsx`:
- Around line 329-331: The catch block in NetworkModificationTreePane (the
try/catch that currently does console.error('Error while exporting study:',
error)) must surface the failure to the user via the app's snackbar flow instead
of only logging; update that catch to call the existing snackbar function used
elsewhere in this component (e.g., enqueueSnackbar or showSnackbar /
showErrorSnackbar) with a clear message like "Failed to export study" and
include the error message/details, and keep the console.error for debugging.
Ensure you import or access the same snackbar instance/context used by other
handlers in this component and use it in the catch block where export errors are
currently logged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c0e4825e-02f3-4dce-899f-8a8f7adadbf7
📒 Files selected for processing (4)
src/components/graph/menus/create-node-menu.tsxsrc/components/network-modification-tree-pane.jsxsrc/services/study/network-modifications.tssrc/services/study/network.ts
| } catch (error) { | ||
| console.error('Error while exporting node Infos:', error); | ||
| console.error('Error while exporting study:', error); | ||
| } |
There was a problem hiding this comment.
Show a user-facing error when export fails.
Line 330 only logs to console, so export failures are silent in UI. Please surface the error through the existing snackbar flow.
Suggested patch
} catch (error) {
- console.error('Error while exporting study:', error);
+ snackWithFallback(snackError, error, { headerId: 'studyExportError' });
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| } catch (error) { | |
| console.error('Error while exporting node Infos:', error); | |
| console.error('Error while exporting study:', error); | |
| } | |
| } catch (error) { | |
| snackWithFallback(snackError, error, { headerId: 'studyExportError' }); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/network-modification-tree-pane.jsx` around lines 329 - 331,
The catch block in NetworkModificationTreePane (the try/catch that currently
does console.error('Error while exporting study:', error)) must surface the
failure to the user via the app's snackbar flow instead of only logging; update
that catch to call the existing snackbar function used elsewhere in this
component (e.g., enqueueSnackbar or showSnackbar / showErrorSnackbar) with a
clear message like "Failed to export study" and include the error
message/details, and keep the console.error for debugging. Ensure you import or
access the same snackbar instance/context used by other handlers in this
component and use it in the catch block where export errors are currently
logged.
|



PR Summary
Import export study