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

Implement DocSearch in Quick Actions Modal #1432

Closed
JonnyBurger opened this issue Oct 22, 2022 · 3 comments · Fixed by #1444
Closed

Implement DocSearch in Quick Actions Modal #1432

JonnyBurger opened this issue Oct 22, 2022 · 3 comments · Fixed by #1444
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt 🥨 hacktoberfest During October, this issue holds a cash bounty!

Comments

@JonnyBurger
Copy link
Member

JonnyBurger commented Oct 22, 2022

Issuehunt badges

🎃 This issue is part of our Hacktoberfest campaign!
📚 Read more about Hacktoberfest here
⏲️ This issue is currently assigned to @uragirii!
💰 Thanks to CodeChem for sponsoring this issue!

I have implemented a Quick Switcher for Remotion, that can be invoked with Cmd+K / Ctrl+K:

image

It currently imports two modes:

  1. If you enter a string, it shows a list of compositions that match this query.
  2. If you enter a string and prefix it with "> ", it shows actions that can be taken from a menu:

image

This task is about implementing a third mode that allows you to find a Documentation page for Remotion.

The following request:

const query = "spring"
await fetch(
	'https://plsduol1ca-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=' +
		encodeURIComponent('Remotion Preview DocSearch') +
		'&x-algolia-api-key=3e42dbd4f895fe93ff5cf40d860c4a85&x-algolia-application-id=PLSDUOL1CA',
	{
		headers: {
			'content-type': 'application/x-www-form-urlencoded',
		},
		body: JSON.stringify({
			requests: [
				{
					query,
					indexName: 'remotion',
					params:
						'attributesToRetrieve=["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"]&attributesToSnippet=["hierarchy.lvl1:10","hierarchy.lvl2:10","hierarchy.lvl3:10","hierarchy.lvl4:10","hierarchy.lvl5:10","hierarchy.lvl6:10","content:10"]&snippetEllipsisText=…&highlightPreTag=<mark>&highlightPostTag=</mark>&hitsPerPage=20&facetFilters=[]',
				},
			],
		}),
		method: 'POST',
	}
).then((res) => res.json());

will return documentation results for spring.

Acceptance criteria

  • Implement a third mode in the Quick Actions modal to find documentation pages based on a query. It does not have to support nesting as Algolia DocSearch, but you can take inspiration from it:

image

  • Do not introduce new dependencies, keep it minimalistic and rather have fewer features than introduce much complexity
  • Make it so that you can prefix any query with "? " to switch to the DocSearch mode, similar to how you can enter > to search for Actions.

IssueHunt Summary

uragirii uragirii has been rewarded.

Backers (Total: $223.00)

Submitted pull Requests


Tips

@issuehunt-oss
Copy link

issuehunt-oss bot commented Oct 22, 2022

@remotion-dev has funded $223.00 to this issue.


@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Oct 22, 2022
@JonnyBurger JonnyBurger added the 🥨 hacktoberfest During October, this issue holds a cash bounty! label Oct 22, 2022
@uragirii
Copy link
Contributor

Can I work on this?

@issuehunt-oss
Copy link

issuehunt-oss bot commented Oct 26, 2022

@jonnyburger has rewarded $200.70 to @uragirii. See it on IssueHunt

  • 💰 Total deposit: $223.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $22.30

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt 🥨 hacktoberfest During October, this issue holds a cash bounty!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants