Repository navigation
Open Markdown files with PlanCake - #11
Merged
Merged
Conversation
Read installer files through CallerFilePath, move the registration parity test next to the .iss it checks, give the exact [Registry] lines with uninsdeletekeyifempty and doubled quotes, check every BOM, add the Windows terms to the glossaries, note the German mnemonic clash until translation, and cover Opening a file in the manuals.
DefaultApps holds the registered application name, the ms-settings link to PlanCake's page in Default apps, a registry check for the installer's registration, and the pure rule that shows the Settings button only when PlanCake is installed and registered. Tests cover the link, all four visibility cases and a registry read that never throws.
The installer now registers a PlanCake.Markdown file type, adds it to each extension's OpenWithProgids, writes an Applications entry and Default apps capabilities under RegisteredApplications, and sets ChangesAssociations. The extensions' default value is never written. MarkdownFileType is added to all six custom message files. InstallerTests checks the message keys, the BOMs and the registration.
The Advanced tab gets a wrapping label and the button "Open &Markdown files with PlanCake...", which opens PlanCake's page in Windows Settings → Default apps. Both are shown only when the installer's registration is there and PlanCake is not portable. The button saves nothing and reports a failure to open Settings in a message box. Tests check the button's place and the label's type, and that the button fits its tab in every language. MnemonicTests fails for German until the button is translated (Task 4): the English &Markdown collides with &Mausklick there.
…glossaries Translate the Settings → Advanced label, the Default apps button and the error when Windows Settings does not open in all five catalogs, with a mnemonic the Settings dialog does not already use in each language (the German button no longer takes M). Add Default apps, Windows Settings, Open with and Choose another app to the glossaries, as Windows names them in each language.
Describe the installer's Markdown registration in Installing (installer, portable, uninstalling), the double-click in Opening a file, and the Default apps button in Settings, Advanced, in all six languages with the catalogs' labels and the glossary terms. Align the Russian, Ukrainian and French names of Windows Settings with the glossaries.
Add the CHANGELOG entry under Unreleased, a README sentence on the Markdown registration, and a CLAUDE.md paragraph on what the installer registers, what it never writes and what InstallerTests checks.
- Name the Default apps button after where it goes, "Choose PlanCake for Markdown files in Windows Settings...", since a screen reader reads only the button's own text on Tab; the label now says "This button opens", as the translations did. Translated in all five catalogs with the same mnemonics, and the six manuals follow. - Hebrew: the label says כפתור and עמוד, as the manual does, and the glossary pins "button". - Manuals: on Windows 10 the button opens the general Default apps page, so say to choose Set defaults by app, then PlanCake, then Manage; both terms are in the five glossaries. - Log a failed read of the registered applications at Warning, so a hidden button can be traced in a Release log. - Installer: build the Oire and PlanCake registry keys from the company and folder defines, so the parent keys and the capabilities key cannot drift apart. - InstallerTests: the guard on the extensions' default value matches .md and .markdown keys under any root and in any case, and fails if it finds none; the RegisteredApplications line must be under HKLM; one helper for the script path; no dead BOM trim. - SettingsDialogTests: drop an assertion that could not fail and name the fit theory after the button it now checks too.
The polling tests drive FileWatcher through a fake timer, but Start also watches the folder for real. The event about the test's own write arrived on a pool thread at any moment and replaced the pending poll with a check, so a test sometimes saw an extra read. The polling tests now pass a synchronizing object that drops those events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
PlanCake opens
.mdand.markdownfiles, but Windows did not know it: the installer registered nothing, so PlanCake was missing from Explorer's Open with list and from Windows Settings → Default apps, and a double-click on a plan never reached it.Since Windows 10 no program can make itself the default for a file type, so the change has two halves:
PlanCake.Markdown, PlanCake in each extension'sOpenWithProgids, anApplications\plancake.exeentry, and capabilities listed underRegisteredApplications. It never writes the extensions' default value, so the program the user chose keeps opening Markdown files, and the ProgID has no verb butopen(File → Open in editor relies on that).ChangesAssociations=yesrefreshes Explorer. The uninstaller removes PlanCake's own keys whole and only its values from the shared keys (uninsdeletevalue,uninsdeletekeyifempty).ms-settings:defaultapps?registeredAppMachine=PlanCake, PlanCake's own page in Default apps (the general Default apps page on older Windows). The button and label show only when the registration is there and PlanCake is not portable.The plan is
docs/plans/completed/002-markdown-association.md. This ships in 1.1, which waits for it.Tasks completed
Utils/DefaultApps.cs)MarkdownFileTypein all six.islfilesReview
IsRegisteredand the dialog wiring (the plan asks for exactly the no-throw test, and the visibility rule is a tested pure function); a{cm:}cross-check (ISCC already fails on an unknown name); the visibility helper as over-engineering (the plan asks for it); a README "Open a file" gap (Installing covers it).DefaultApps; mnemonics in all six languages; TableLayoutPanel, WrappingLabel and tab order; the manuals' ids and links.master...HEAD): no actionable issues found.Validation
All passed on the final commit:
./src/PlanCake/locale/scripts/Compile-Translations.ps1 -Strict(no fuzzy entries)dotnet builddotnet test(1286 tests)dotnet format --verify-no-changes./installer/Build-Installer.ps1 -AllowDirty(the installer compiles; it was not run)FileWatcherTests.Polling_ReadsTheFileOnlyWhenItsSizeOrTimeChangedandPolling_LooksAtTheFileEverySecond_AndReportsAChangefailed now and then and passed on a rerun. They come from the WSL polling change, not this one, but they are flaky enough to need their own fix.To check by hand
Installer, on a machine where another program already opens
.md:RegisteredApplicationsvalue are gone, thatOpenWithProgidslost only PlanCake's value, and that the other program still opens.md.Repeat on Windows 10 if one is at hand.
JAWS, in Settings → Advanced:
Check the Hebrew interface too.
Windows 10 terms: the Ukrainian and Hebrew names for "Set defaults by app" and "Manage" in the manuals and glossaries were not checked against a localized Windows 10.