Skip to content

Support block label#12

Open
mzueva wants to merge 5 commits into
mainfrom
mzueva/support-block-labels
Open

Support block label#12
mzueva wants to merge 5 commits into
mainfrom
mzueva/support-block-labels

Conversation

@mzueva
Copy link
Copy Markdown
Contributor

@mzueva mzueva commented Jan 21, 2026

Support block label

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @mzueva, 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 introduces a new feature to support configurable block labels, providing more descriptive and dynamic titles for application blocks. It includes necessary model changes to define these labels, UI logic for their initialization and dynamic display, and a refactoring of internal output handling. Additionally, a significant number of project dependencies have been updated to their latest versions, ensuring the application remains current with its underlying libraries.

Highlights

  • Block Label Support: Introduced defaultBlockLabel and customBlockLabel properties to the BlockArgs type, allowing for flexible and dynamic block titling within the application.
  • Dynamic Subtitle Implementation: Implemented a new .subtitle method in the platforma block model, which dynamically displays either the customBlockLabel or defaultBlockLabel, enhancing UI clarity.
  • Output Method Refactoring: Refactored several block output methods from .output to .outputWithStatus (e.g., overlapColumns, overlapTable), indicating an update to a more robust API for handling output states.
  • Dependency Updates: Performed a comprehensive update of numerous package dependencies, including @milaboratories and @platforma-sdk components, to their latest minor or patch versions, ensuring compatibility and leveraging new features.
  • UI Label Initialization and Dynamic Update: Added logic in the UI to initialize customBlockLabel and defaultBlockLabel upon app load and to dynamically update the defaultBlockLabel in OverlapPage.vue based on the selected input dataset.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link
Copy Markdown

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

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 introduces support for a customizable block label, which is displayed as a subtitle. The implementation adds defaultBlockLabel and customBlockLabel to the block arguments and uses them to generate the subtitle. The logic for updating the default label based on the selected dataset is correctly implemented. However, it is currently placed within a page-specific component, which could lead to inconsistent UI behavior when navigating between different pages of the block. I have provided a recommendation to move this logic to a global application scope to ensure consistency. Other changes, such as dependency updates and API adaptations, appear to be in order.

Comment thread ui/src/pages/OverlapPage.vue Outdated
Comment on lines +16 to +23
watchEffect(() => {
const inputRef = app.model.args.inputAnchor;
if (inputRef) {
app.model.args.defaultBlockLabel = app.model.outputs.inputOptions?.find((o) => plRefsEqual(o.ref, inputRef))?.label ?? '';
} else {
app.model.args.defaultBlockLabel = 'Select dataset';
}
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This watchEffect is page-specific, which means the block's subtitle will not update correctly if the user changes the dataset while on a different page (e.g., 'By Sample'). This logic should be moved to a central location like ui/src/app.ts to ensure it applies globally across the entire block. This will fix the bug and improve maintainability by keeping all global state logic in one place.

Please remove this watchEffect from here and add the following logic inside the defineApp callback in ui/src/app.ts:

// in ui/src/app.ts

// You'll need to add this import at the top of the file:
// import { plRefsEqual } from '@platforma-sdk/model';

watch(() => [app.model.args.inputAnchor, app.model.outputs.inputOptions] as const, ([inputAnchor, inputOptions]) => {
  if (inputAnchor) {
    app.model.args.defaultBlockLabel = inputOptions?.find(({ ref }) => plRefsEqual(ref, inputAnchor))?.label ?? '';
  } else {
    app.model.args.defaultBlockLabel = 'Select dataset';
  }
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

agree, should be fixed

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.

@kevindetry-milaboratories What do you think? We we following general approach from example block "clonotype-clustering", where this logic was implemented on the Main page. Does it make sense to change it as general approach?

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.

3 participants