Skip to content

Conversation

@UnschooledGamer
Copy link
Member

No description provided.

@UnschooledGamer UnschooledGamer linked an issue Jan 9, 2026 that may be closed by this pull request
1 task
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @UnschooledGamer, 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 refactors the run function within the EditorFile class by eliminating a redundant conditional check. The change streamlines the logic for setting the preview mode, ensuring that the appSettings.value.previewMode is consistently applied without an unnecessary file variable check, thus improving code clarity and correctness.

Highlights

  • EditorFile class run function: An unnecessary conditional expression (file ? "inapp" : ...) has been removed from the run function, simplifying the logic for determining the preview mode.
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.

@UnschooledGamer UnschooledGamer changed the title fix: Remove unnecessary condition from run function in EditorFile class fix: Should use Current File For Preview not respecting preview mode Jan 9, 2026
@UnschooledGamer UnschooledGamer changed the title fix: Should use Current File For Preview not respecting preview mode fix: Should use Current File For Preview option not respecting preview mode Jan 9, 2026
gemini-code-assist[bot]

This comment was marked as resolved.

@UnschooledGamer
Copy link
Member Author

@greptileai

@greptile-apps
Copy link

greptile-apps bot commented Jan 9, 2026

Greptile Overview

Greptile Summary

This PR fixes a bug where the "Use Current File For Preview" option (useCurrentFileForPreview) was not respecting the user's configured previewMode setting.

What Changed

The #run(file) method in EditorFile was modified to remove conditional logic that forced the preview target to "inapp" when the file parameter was truthy (i.e., when runFile() was called).

Before:

run(false, file ? "inapp" : appSettings.value.previewMode, file);

After:

run(false, appSettings.value.previewMode, file);

Impact

  • When users enable the useCurrentFileForPreview setting, their previewMode preference (browser vs in-app) will now be properly respected
  • Previously, using "current file for preview" would always force in-app preview mode, overriding the user's preference
  • This change aligns the behavior of run() and runFile() to consistently use the configured previewMode

The fix is minimal, targeted, and correctly addresses the issue described in the PR title.

Confidence Score: 5/5

  • Safe to merge - simple bug fix that correctly removes problematic conditional logic
  • The change is a one-line fix that removes an unnecessary conditional that was overriding user preferences. The modification is minimal, well-targeted, and aligns both code paths (run and runFile) to consistently respect the previewMode setting. No blocking issues identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/lib/editorFile.js 5/5 Removed conditional override that forced 'inapp' mode when file parameter was truthy, allowing previewMode setting to be consistently respected

Sequence Diagram

sequenceDiagram
    participant User
    participant EditorFile
    participant run.js
    participant Browser/InApp

    Note over User: User clicks Run button<br/>with useCurrentFileForPreview enabled

    User->>EditorFile: runFile()
    EditorFile->>EditorFile: #run(true)
    Note over EditorFile: Before fix: forced target="inapp"<br/>After fix: uses appSettings.value.previewMode
    EditorFile->>run.js: run(false, appSettings.value.previewMode, true)
    
    alt previewMode === "browser"
        run.js->>Browser/InApp: system.openInBrowser()
    else previewMode === "inapp"
        run.js->>Browser/InApp: browser.open()
    end

    Note over User: User clicks Run button<br/>with useCurrentFileForPreview disabled

    User->>EditorFile: run()
    EditorFile->>EditorFile: #run(false)
    EditorFile->>run.js: run(false, appSettings.value.previewMode, false)
    
    alt previewMode === "browser"
        run.js->>Browser/InApp: system.openInBrowser()
    else previewMode === "inapp"
        run.js->>Browser/InApp: browser.open()
    end
Loading

@bajrangCoder bajrangCoder marked this pull request as ready for review January 9, 2026 13:49
@UnschooledGamer UnschooledGamer added enhancement New feature or request CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. labels Jan 9, 2026
@github-actions github-actions bot removed the CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. label Jan 9, 2026
@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Preview Release for this, has been built.

Click here to view that github actions build

@UnschooledGamer UnschooledGamer changed the title fix: Should use Current File For Preview option not respecting preview mode fix: run current File not respecting preview mode option. Jan 9, 2026
@UnschooledGamer UnschooledGamer merged commit 68291d5 into main Jan 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: Preview Mode Constraint

3 participants