Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Microsoft Learn Extension #386

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

[WIP] Microsoft Learn Extension #386

wants to merge 3 commits into from

Conversation

michael-hawker
Copy link
Collaborator

Summary of the Pull Request

This PR brings in my hackathon test extension to search the Microsoft Learn Docs. It basically encodes this search form into an extension (that's the goal): https://learn.microsoft.com/en-us/search/?terms=ComboBox

The current implementation searches a specific product (Windows App SDK docs).

It almost works again with the latest in main (it compiles), but seems like displayed results are delayed. Though I haven't completely updated the pattern as per some other samples yet, so I'm probably doing something wrong there?

Need a pointer to example settings as well, as I need a toggle settings for the doc product areas (guids) to include in searches and a combobox for content area.

TODO

  • Fix implementation with latest version of CmdPal (results delayed until next load of page)
  • Implement paging with Load More Items and the pages of the doc search query API
  • chore: Map form options from webpage options to values needed to pass to search query (mostly a pain for each product as guid)
  • Provide setting for Content Area (ComboBox - single choice of multiple options)
  • Provide settings for each product option (toggles - multiple choices from a list of options)
  • test: Ensure none (all), single, and multiple selected products work for query
  • probably future/'v2': Would be cool if used details panel to show preview of doc page or something... (maybe option...?)

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

server.RegisterExtension(() => extensionInstance);

// This will make the main thread wait until the event is signalled by the extension class.
// Since we have single instance of the extension object, we exit as sooon as it is disposed.

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[sooon](#security-tab) is not a recognized word. \(unrecognized-spelling\)
Copy link

@check-spelling-bot Report

🔴 Please review

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

Unrecognized words (1)

devrel

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

... in a clone of the [email protected]:zadjii-msft/PowerToys.git repository
on the llama/docsext branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/zadjii-msft/PowerToys/actions/runs/13064179707/attempts/1'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
@check-spelling-bot apply updates.

Errors (1)

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

❌ Errors Count
❌ ignored-expect-variant 5

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.

public override void UpdateSearchText(string oldSearch, string newSearch)
{
IsLoading = true;
GetItems();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO I would do the search here, build the results, cache them into a member, then RaiseItemsChanged. Then in GetItems(), just return the cached member

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.

2 participants