Skip to content

MILAB-5607: use graph-maker plugin - #35

Open
erohinaelena wants to merge 3 commits into
mainfrom
migrate-to-model-v3
Open

MILAB-5607: use graph-maker plugin#35
erohinaelena wants to merge 3 commits into
mainfrom
migrate-to-model-v3

Conversation

@erohinaelena

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the block's internal architecture by migrating to a new data model (BlockModelV3) and integrating the graph-maker plugin. This change centralizes the management of graph states within dedicated plugins, leading to a more modular, maintainable, and scalable codebase. The update streamlines how plot configurations and data are handled, improving the overall structure and future extensibility of the block.

Highlights

  • Data Model Migration: Migrated the block's data model from BlockModel to BlockModelV3 using DataModelBuilder, enabling a more structured approach to data versioning and state management.
  • Graph-Maker Plugin Integration: Integrated the @milaboratories/graph-maker/plugin to manage the state of V, J, and V/J usage plots, centralizing graph configurations and interactions within dedicated plugin instances.
  • Refactored Block Data Access: Refactored block data access patterns across UI components, transitioning from app.model.args and app.model.ui to app.model.data to align with the new BlockModelV3 structure.
  • Dependency Updates: Upgraded various @platforma-sdk and @milaboratories dependencies to their latest versions, ensuring compatibility and leveraging new features.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the block to use the graph-maker plugin with BlockModelV3, which is a significant and positive architectural change. The UI code has been updated correctly to align with this new plugin-based approach. However, I've found a critical issue in the model definition: the plugins are configured to use an output named pf which is no longer defined in the model. This will prevent the block from functioning. Once this is addressed, the PR should be in good shape.

Comment thread model/src/index.ts
Comment on lines +203 to +205
.plugin(vUsagePlugin, {
blockColumns: (ctx) => ctx.outputs?.resolve('pf')?.getPColumns(),
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The graph-maker plugin is configured to get its blockColumns from an output named pf. However, the pf output, which was present in the previous model version, has been removed in this refactoring. As a result, ctx.outputs?.resolve('pf') will be undefined, and the block will fail to get data for the graphs.

You need to ensure the data is provided to the plugins. This could be done by:

  1. Re-introducing an output that provides the PColumn[] for the graphs. The graph-maker plugin might even offer a utility function for this.
  2. Revisiting the plugin configuration if blockColumns is not the intended way to pipe data in this new setup.

Comment thread ui/src/pages/VUsage.vue Outdated
if (isRunning && !wasRunning) {
// Close the settings tab by setting currentTab to null
app.model.ui.vUsagePlotState.currentTab = null;
(vUsagePlugin.model.data.state as { currentTab: null }).currentTab = null;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to move this inside or remove, or add a setting. I'll ask Maria.

Comment thread ui/src/pages/VUsage.vue Outdated
if (isRunning && !wasRunning) {
// Close the settings tab by setting currentTab to null
app.model.ui.vUsagePlotState.currentTab = null;
(vUsagePlugin.model.data.state as { currentTab: null }).currentTab = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to discuss this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants