Skip to content

v3.6.18#321

Merged
jparkerweb merged 4 commits into
mainfrom
issue-318
Mar 8, 2026
Merged

v3.6.18#321
jparkerweb merged 4 commits into
mainfrom
issue-318

Conversation

@jparkerweb

Copy link
Copy Markdown
Owner

v3.6.18 - 2026-03-08

🐛 Fixed

…oups (#318)

Store lastFrontmatter immediately on any frontmatter change (not just
when banner-relevant fields change) so subsequent comparisons have a
correct baseline. Add banner-relevant field filtering to the resolved
handler to prevent unnecessary re-renders. Clear lastFrontmatter cache
on settings save alongside other caches.
@jparkerweb jparkerweb merged commit 02a3464 into main Mar 8, 2026
1 check passed
@gemini-code-assist

Copy link
Copy Markdown
Contributor

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 delivers a patch release, version 3.6.18, primarily addressing a bug that caused banners to flicker during typing in notes with frontmatter and folder group banners. The underlying cause was an overly aggressive banner update mechanism, which has now been optimized to only react to changes in banner-specific frontmatter fields, significantly improving user experience and performance.

Highlights

  • Bug Fix: Resolved an issue causing banner flickering on every keystroke when a note contains frontmatter and uses folder group banners (issue 🐛 Banner flickers on every keystroke when note contains frontmatter (folder groups) #318).
  • Performance Optimization: Improved frontmatter change detection logic to prevent unnecessary banner updates, only triggering a refresh when relevant banner-related fields in the frontmatter have actually changed.
  • Version Update: Incremented the plugin version to 3.6.18 across relevant configuration files.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • CHANGELOG.md
  • UPDATE.md
  • manifest.json
    • Updated the plugin version from 3.6.17 to 3.6.18.
  • package-lock.json
    • Updated the package version from 3.6.17 to 3.6.18.
  • package.json
    • Updated the package version from 3.6.17 to 3.6.18.
  • src/core/pixelBannerPlugin.js
    • Refined the metadataCache.on('changed') event listener to store the latest frontmatter before comparison and only trigger banner updates if relevant banner-related fields have changed.
    • Optimized the metadataCache.on('resolved') event listener to prevent banner updates unless specific banner-related frontmatter fields have been modified.
    • Removed several console.log statements used for debugging.
  • src/core/settings.js
    • Added plugin.lastFrontmatter.clear() to the saveSettings function to ensure cached frontmatter is cleared upon settings save.
  • tests/unit/core/domManager.test.js
    • Added lastFrontmatter property to the mock plugin object for testing purposes.
  • tests/unit/core/eventHandler.test.js
    • Added lastFrontmatter property to the mock plugin object for testing purposes.
  • tests/unit/core/settings.simple.test.js
    • Added lastFrontmatter property to the mock plugin object and included a test to ensure it is cleared when settings are saved.
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.

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

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.

Code Review

This pull request addresses a banner flickering issue (issue #318) by refining how frontmatter changes are detected in metadataCache event listeners. The core logic change appears sound and correctly prevents unnecessary banner updates on every keystroke.

My review includes a few suggestions:

  • Correcting a typo in the date and removing a duplicated entry in the changelog files.
  • A refactoring suggestion for src/core/pixelBannerPlugin.js to address significant code duplication between two event handlers. This will improve the maintainability of the code.

The version bumps and test file updates are all appropriate for this change.

Comment thread CHANGELOG.md

All notable changes to the Pixel Banner plugin will be documented in this file.

### v3.6.18 - 2026-03-08

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.

medium

There seems to be a typo in the date for this version. It's set to 2026-03-08, which is in the future. Please correct it to the actual release date.

Comment thread UPDATE.md
Comment on lines +137 to +140
### v3.6.18 - 2026-03-08
#### 🐛 Fixed
- Fixed banner flickering on every keystroke when a note contains frontmatter and uses folder group banners (issue #318)

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.

medium

This changelog entry for v3.6.18 appears to be a duplicate of the one on lines 129-132. Please remove this redundant block.

Comment on lines +512 to +544
const relevantFields = [
...this.settings.customBannerField,
...this.settings.customYPositionField,
...this.settings.customXPositionField,
...this.settings.customContentStartField,
...this.settings.customImageDisplayField,
...this.settings.customImageRepeatField,
...this.settings.customBannerMaxWidthField,
...this.settings.customBannerHeightField,
...this.settings.customFadeField,
...this.settings.customBorderRadiusField,
...this.settings.customTitleColorField,
...this.settings.customBannerShuffleField,
...this.settings.customBannerIconField,
...this.settings.customBannerIconSizeField,
...this.settings.customBannerIconImageSizeMultiplierField,
...this.settings.customBannerIconTextVerticalOffsetField,
...this.settings.customBannerIconRotateField,
...this.settings.customBannerIconImageAlignmentField,
...this.settings.customBannerIconXPositionField,
...this.settings.customBannerIconOpacityField,
...this.settings.customBannerIconColorField,
...this.settings.customBannerIconFontWeightField,
...this.settings.customBannerIconBackgroundColorField,
...this.settings.customBannerIconPaddingXField,
...this.settings.customBannerIconPaddingYField,
...this.settings.customBannerIconBorderRadiusField,
...this.settings.customBannerIconVerticalOffsetField
];

const hasRelevantChange = relevantFields.some(field =>
frontmatter[field] !== previousFrontmatter?.[field]
);

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.

medium

There's significant code duplication between this metadataCache.on('resolved', ...) handler and the metadataCache.on('changed', ...) handler (lines 163-230). The logic for defining relevantFields and checking for changes is nearly identical in both places.

To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, I suggest refactoring this duplicated logic into helper methods on the PixelBannerPlugin class.

For example, you could create:

  1. A method to get the list of relevant fields:
    getRelevantBannerFields() {
      return [
        ...this.settings.customBannerField,
        // ... all other fields
      ];
    }
  2. A method to check for changes in these fields:
    hasRelevantBannerFieldChange(frontmatter, previousFrontmatter) {
      if (!previousFrontmatter) return true; // Or handle as needed
      const relevantFields = this.getRelevantBannerFields();
      return relevantFields.some(field => frontmatter[field] !== previousFrontmatter[field]);
    }

Then, both event handlers can call these helper methods, making the code cleaner and easier to maintain.

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.

1 participant