-
Notifications
You must be signed in to change notification settings - Fork 3
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
docs: create Docusaurus documentation site for Copilot by Detox #29
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's start from removing some redundancy, ok?
website/docusaurus.config.js
Outdated
favicon: '/img/homepage/detox-logo.png', | ||
|
||
// Set the production url of your site here | ||
url: 'https://your-docusaurus-site.example.com', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is better to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does 'https://copilotbydetox.com/' sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you deploy it to, currently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know actually. Can I just choose to deploy to this address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please fix your .nvmrc
to use lts/jod
(Node 22), instead of that embarrasing thing inside: 😅 I mean, just like a grenade that did not explode, there's this snippet of Shell script there inside:
echo "20" > .nvmrc
Overall, good job, but a few places still need some polish.
website/src/pages/index.module.scss
Outdated
height: auto; | ||
border-radius: 8px; | ||
|
||
@media only screen and (max-width: 1200px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look, the bottomRightGif CSS is not good. Even 7+ media queries with hard-coded values don't save your day:
There are two approaches to fix this:
-
If you stick to absolute positioning, use linear interpolation (lerp) principles. Instead of discrete breakpoints, we need a continuous function that smoothly transitions between viewport sizes:
.bottomRightGif { position: absolute; /* Linear scaling function: f(x) = mx + b where: m = (y2-y1)/(x2-x1) for the scaling rate b = y-intercept for minimum values */ width: min(850px, calc(40vw + 300px)); right: max(20px, calc(2vw + 10px)); bottom: max(20px, calc(2vw + 10px)); }
This follows the principle of linear regression where we map viewport width to element dimensions (dependent variable), creating a continuous scaling function rather than discrete steps.
The numbers in the example are random, magical and serve just for illustration. The syntax aboutmin
/max
has to be taken with a grain of salt — it should work in CSS 2020+, but I never checked it personally as I touch website code not that often, sorry. -
Maybe consider CSS Grid, who knows?
.heroBanner { display: grid; grid-template-columns: 1fr min(850px, 100%); // again, numbers just for illustration }
The current implementation with 7+ media queries is essentially trying to approximate a linear function with step functions - that's why you get those awkward jumps between breakpoints.
Either implement proper linear scaling or use some layout systems.
P.S. Whatever approach you choose, test it with various screens (360px, and drag width slider slowly and check). The current implementation breaks on 1200px, for example. We don't want that in production.
website/src/pages/index.js
Outdated
<img | ||
src="/img/homepage/copilot-demo.gif" | ||
alt="Demo Gif" | ||
className={styles.bottomRightGif} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not convinced that GIF is the best solution in this case.
- It does not compress well; consider using WebP or other more modern formats instead.
- To enhance user experience, a video file (WebM or whatever) would be ideal. This allows viewers to open it in fullscreen mode, pause/resume, etc. making it more usable, especially on mobile devices.
This commit adds a new Docusaurus-based documentation site with: ### Guides Section: - **Integrating with Testing Frameworks:** Overview of Copilot's capabilities. - **Technical Overview:** Adapted from Detox docs (to be removed there). - **Best Practices:** Framework-agnostic step-by-step guidance. - **Custom Driver Implementation:** Guide to creating and adding testing framework drivers. - **Contributing:** Details on adding prompt handlers and drivers, with tips and github link. ### API Section: - **Interface Overview:** Lifecycle commands (`init`, `start`, `perform`, `end`). - **Prompt Handlers:** Writing and contributing (`src/prompt-handlers`). - **Framework Drivers:** Custom implementation, snapshot support, and type references. ### Showcase Page: - Highlights Detox as the initial use case and invites collaboration with other frameworks.
**Docusaurus leftovers were deleted. **The link to edit the page was updated. **The URL for the website was updated.
48665ea
to
a03e89d
Compare
d384b26
to
f993e45
Compare
This commit adds a new Docusaurus-based documentation site with:
Guides Section:
API Section:
init
,start
,perform
,end
).src/prompt-handlers
).Showcase Page: