microsoft / microsoft/vscode-pull-request-github

Option to *not* close file marked as viewed via keybinding

Offen
#5,092 7 Kommentare 13 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature-request good first issue
Vorherrschende Sprache
TypeScript
Sterne
2.6k
Forks
796
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
46

Beschreibung

When you mark a file as viewed through the active editor menu bar or through a keybinding, the file will close. When you mark it as viewed through the tree view then it will not close. If a setting is needed I'll add one, but my hope is that this behavior is better for almost everyone.

Originally posted by @alexr00 in https://github.com/microsoft/vscode-pull-request-github/issues/3513#issuecomment-1284469843

Per this comment, it seems the default behavior for keybindings (or editor menu bar) calling pr.markFileAsViewed is to close the file, but for my workflow I'd prefer it didn't. Is it possible to add either a config setting, new command, or allow "args" in the keybinding to disable closing the active editor when this command is executed?

If it would be accepted, I could also attempt a PR for whichever of those options seems preferable. Thanks!

Edit: as a workaround (at least for keybindings) I found this seems to work okay - although the visual effect of closing and immediately reopening the editor is a bit jarring:

    {
        "key": "alt+j",
        "command": "runCommands",
        "args": {
            "commands": [
                "pr.markFileAsViewed",
                "workbench.action.reopenClosedEditor",
            ]
        },
        "when": "editorTextFocus && github:inReviewMode && isInDiffEditor",
    }

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Befehl pr.markFileAsViewed von seinen Keybinding- und Menüleisteneinstiegspunkten im aktiven Editor aus nachzuverfolgen und sie mit dem im Issue beschriebenen Verhalten der Tree-View zu vergleichen. Es werden keine Quelldateien oder Tests genannt; die Aufgabe ist abgeschlossen, wenn eine akzeptierte Möglichkeit bereitgestellt wird, den Befehl aufzurufen, ohne den aktiven Editor zu schließen, und dabei das bestehende Verhalten standardmäßig beibehalten wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, vscode
Bereich
developer-experience
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
50/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.