3.3.0
RefactoringMiner Extension v3.3.0
Mostly new ground. The refactorings panel is back in the full-width form it had before, in three sizes you pick from the options page; the descriptions it shows now link to the code they name; and the parts of a refactoring that are only reached by it, the call sites an extraction leaves behind and the statements that mention a renamed variable, are finally told apart from the parts that changed. One fix worth its own heading: with automatic activation switched on, the extension did nothing until you reloaded the page.
New: the panel comes in three sizes, and the widest one is back
The panel that lists every refactoring was a small card pinned bottom-left. That is still the default, but the options page now sets how much of the diff it takes, and with it how much of each refactoring's RefactoringMiner record it shows. All three list the same refactorings and highlight the same lines:
- Compact, the pinned bottom-left card. Type and the element it touched, one row each; the full description opens on click. Unchanged from previous releases.
- Expanded, the same card elongated along the bottom, with each refactoring's full description printed on its row.
- Detailed, a dock across the entire width of the window. The description, plus every code element RefactoringMiner reported for that refactoring (its role in the refactoring, its kind, and its
file:line, each one clickable), and a checkbox per refactoring type so you can show one kind at a time.
The detailed dock is the old Refactoring-Aware-Commit-Review full-width panel, brought back as an option. Full width is what makes the long descriptions readable; a card a third of the screen wide could not show them without wrapping them into a column. Click the dock's header to collapse it out of the way, and again to bring it back; the setting stays where you left it.
The type checkboxes hide rows, and the navigator and minimap entries that go with them. Nothing is un-analysed by them and nothing in the diff is un-tagged, so a filtered-out line still lights up if you click it in the diff.
The disclosure caret is now compact-only. The two richer levels print the description on the row itself, so a caret there only opened a second copy of what was already on screen.
New: descriptions link to the code they name
RefactoringMiner sends each refactoring's description twice: as plain prose, and as markup, the same sentence with every code element linked to the line it sits on. Wherever the panel shows a description it now renders the markup, so each element is clickable and takes you to that line rather than to the refactoring's default landing spot. A feed without markup falls back to the prose, unlinked.
Arriving there, the element itself is highlighted, not the whole diff row. The row already carries the selection fill, so painting the element the same way would say nothing about which part of the line the description meant. The element takes the complement of that fill instead: the opposite hue, the opposite end of the lightness scale, and its own text colour so the code stays readable on it. Amber lines get a blue element, azure lines an orange one, flipped in GitHub's dark theme. Its extent comes from the startColumn/endColumn RefactoringMiner reports.
Clicking never navigates. The panel intercepts the click and reveals the line in place, which is what lets it unfold a collapsed hunk, expand a file hidden behind "Viewed", or mount a virtualized row first, none of which a plain jump to an anchor can do. The links stay real <a href>s, so Cmd- or Ctrl-click still opens a tab, and those addresses are rewritten to point at the page you are actually on. That last part matters because the service is called with a single commitId and cannot tell a standalone commit from a commit that happens to sit inside a pull request, so a sha request always emits regular-commit links, which point off a /pull/<n>/changes/<sha> page entirely.
New: invocations and references have their own colour, and stay out of the counts
RefactoringMiner reports two quite different kinds of location for one refactoring: the code that changed, and the code that merely reaches it. Extract Method reports the extracted method, and the call sites left behind where the code used to be. Rename Variable reports the declaration, and every statement that mentions the variable. Until now both were painted in the same left and right colours, counted the same way, and behaved the same way, so a rename of a variable used in twelve places read as a twelve-line change.
Only the location's own description separates them (extracted method invocation, statement referencing the renamed variable), and that is now what the extension goes on. Those lines:
- Take a third highlight colour, configurable on the options page next to the existing pair. The default is a violet that sits in the gap between the amber and azure of the two sides, clear of the red and green GitHub already uses for removed and added lines, and matched to the same brightness as that pair so a call site never looks louder than the change that produced it. As with the other two, a colour you pick applies in both of GitHub's themes.
- Are left out of the off-screen line counts. The pills at the top and bottom of the screen count how much of the selected refactoring is above and below the fold; they now count only the lines it actually changed, and clicking one takes you to one of those rather than to a call site.
- Do nothing when clicked. There is no counterpart to pair a call site with, and jumping on the strength of one would move you away from the change you were looking at. Clicking one is now a no-op; it will not even clear the selection you already had.
- Have their own hover instead. Short, and in RefactoringMiner's own words: "Extracted method invocation", and underneath it, which refactoring reaches this line. No counterpart preview, because there is nothing to preview.
All of this follows whatever is selected, rather than being fixed when the diff is painted. One line can be a reference belonging to one refactoring and changed code belonging to another sitting right below it; it takes its colour, its counting, and its description from whichever of the two you have selected.
Fixed: with automatic activation on, nothing happened until you reloaded
Switching on automatic activation in the options page was supposed to mean the extension came up by itself on a diff. Instead you would arrive at a pull request's "Files changed", get nothing, reload the page, and only then see the panel. The toolbar button was equally dead in that state, which made it look like the setting had broken activation altogether.
A content script is put into a page when a document loads, and never again. GitHub does not load documents when you move around it: opening a pull request from the repository page, the pull list, or a notification replaces the URL and the whole interface in place. The extension registers itself for diff URLs only, so arriving at one that way meant it had never been put into the page at all. There was nothing there to activate, and nothing for the toolbar button to talk to. Reloading worked because a reload is a real document load.
The extension now notices a tab settling on a diff and puts itself in if it is not already there, checking first so it can never end up running twice in one page. The toolbar button does the same check before it fires, so click-to-activate works on arrival too.
A second fault underneath that is also fixed: the watcher that tags new rows as a big diff scrolls was attached once to the page body, and a GitHub navigation replaces that body wholesale. It was left watching a discarded page, and rows mounted after such a navigation quietly stopped being highlighted.
Fixed: going to a refactoring took you to its call site
Clicking a refactoring in the panel, stepping to it with the navigator, or following a minimap tick would sometimes scroll you to the invocation rather than to the refactoring itself. For Extract Method, most of the time.
Where to land was decided by taking the first of the refactoring's lines that was mounted in the page, and that list is in page order, so it was really "whichever of its lines is highest up". A call site left behind by an extraction sits above the extracted method it calls, so it won that comparison. Landing now skips the lines a refactoring only reaches, and falls back to them only if it has nothing else mounted, so a refactoring is never unreachable.
Fixed: the panel stayed shut when you clicked a refactoring in the diff
Clicking a row in the panel opened that row's explanation. Clicking the same refactoring's highlighted line in the diff marked the row as current but left it closed, so the two routes to the same refactoring did not agree. Selecting from the diff now opens the explanation as well, and when the line you clicked carries several refactorings, it opens all of them, in list order.
Changed: the options page saves as you go
The Save button is gone; every control writes itself the moment you change it, and a small confirmation appears wherever you are on the page. The settings are independent one-click choices, and having one button at the foot of the page meant changing the panel size at the top ended in a scroll just to commit it. Typed fields and the speed slider are still batched, so one gesture is one write.
One new permission
This release asks for scripting, which is what lets the extension put itself into a diff you reached without a page load, the activation fix above. There is no other way to do it under Manifest V3. It grants nothing on top of the access the extension already had to github.com, Chrome shows no new warning for it, and the pages the extension runs on are unchanged.