Skip to content

Fix Cmd+R keyboard shortcut when dialogs are open#113

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-cmd-r-refresh-issue
Draft

Fix Cmd+R keyboard shortcut when dialogs are open#113
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-cmd-r-refresh-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

Cmd+R (reset viewport) was non-functional when AlertDialog components were open because modal dialogs capture keyboard focus, preventing event propagation to the app root handler.

Changes

  • FileDetailsDialog & PrDetailsDialog: Added onPreviewKeyEvent modifier to intercept Cmd+R and call onResetViewport()
  • DialogHost: Added onResetViewport parameter and threaded it through to child dialogs
  • App: Wired vm.resetViewport() callback to dialog hierarchy

Implementation

@OptIn(ExperimentalComposeUiApi::class)
AlertDialog(
    onDismissRequest = onDismiss,
    modifier = Modifier.onPreviewKeyEvent { event ->
        if (event.type == KeyEventType.KeyDown && event.isMetaPressed && event.key == Key.R) {
            onResetViewport()
            true
        } else {
            false
        }
    },
    // ...
)

Pattern matches existing keyboard handler in App.kt lines 203-207.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx3072M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3/lib/gradle-daemon-main-8.14.3.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>cmd + R が効かない時がある</issue_title>
<issue_description>PRをunselectすると効くようになる。refreshするとまた効かなくなる。</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: HayatoYagi <26685974+HayatoYagi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cmd + R functionality issue on refresh Fix Cmd+R keyboard shortcut when dialogs are open Mar 1, 2026
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.

cmd + R が効かない時がある

2 participants