Skip to content

Conversation

@jiripolasek
Copy link
Collaborator

Summary of the Pull Request

This ii a bit ahead of its time. I need as part of yet another PoC, but it’s best to keep it separate.

This PR introduces new types of IContent:

  • Plain text content – simple and straightforward, with options to switch between UI and monospace fonts and toggle word wrap.
    • It's super safe to display any random text content without having to worry about escaping the pesky markdown.
  • Image viewer content – a more polished way to display images:
    • When placed in the ContentPage, the component automatically resizes to fit the viewport, ensuring the entire image is visible at once.
    • Images can be opened in a built-in mini-viewer that lets you view, pan, and zoom without leaving the Command Palette. (Doing this directly on the page proved to be a UX and development headache.) Fully keyboard-controllable, so there’s no need to take your hands off the keys.

Pictures? Pictures!

Plain text content:

image image

Image viewer content:

Recording.2025-11-29.064042.mp4

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@jiripolasek jiripolasek added the Product-Command Palette Refers to the Command Palette utility label Nov 29, 2025
if (height > 0)
{
var pageLimit = Math.Max(0, height - MaxHeightSafetyPadding);
if (ViewModel?.MaxHeight is double vmh and > 0)

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

vmh is not a recognized word. (unrecognized-spelling)
var pageLimit = Math.Max(0, height - MaxHeightSafetyPadding);
if (ViewModel?.MaxHeight is double vmh and > 0)
{
ImageBorder.MaxHeight = Math.Min(pageLimit, vmh);

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

vmh is not a recognized word. (unrecognized-spelling)
ImageBorder.MaxHeight = pageLimit;
}
}
else if (ViewModel?.MaxHeight is double vmh2 and > 0)

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

vmh is not a recognized word. (unrecognized-spelling)
}
else if (ViewModel?.MaxHeight is double vmh2 and > 0)
{
ImageBorder.MaxHeight = vmh2; // fallback if page height not ready

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

vmh is not a recognized word. (unrecognized-spelling)
Text = """
# Sample Plain Text Content
This is a sample plain text content page.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Letraset is not a recognized word. (unrecognized-spelling)
Text = """
# Sample Plain Text Content
This is a sample plain text content page.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Check warning

Code scanning / check-spelling

Candidate Pattern Warning

@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (2)

Letraset
vmh

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the git@github.com:jiripolasek/PowerToys.git repository
on the feature/41038-cmdpal-moar-content branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/19779793930/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spell-check/patterns.txt:

# Automatically suggested patterns

# hit-count: 2 file-count: 1
# Lorem
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
# ... Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary).
# ... You could manually change `(?i)X...` to use `[Xx]...`
# ... or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path)
(?:(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*)

Alternatively, if a pattern suggestion doesn't make sense for this project, add a #
to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Notices ℹ️ (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

ℹ️ Notices Count
ℹ️ candidate-pattern 1

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: New content block for plain text (PlainTextContent)

1 participant