Skip to content

Commit 46b7214

Browse files
CopilotMohabMohie
andauthored
Update AutoBot to use new user guide URL and improve mobile UX (#353)
* Initial plan * Update AutoBot instructions and improve mobile responsiveness Co-authored-by: MohabMohie <19201898+MohabMohie@users.noreply.github.com> * Address code review feedback - improve AI instruction clarity and simplify CSS Co-authored-by: MohabMohie <19201898+MohabMohie@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MohabMohie <19201898+MohabMohie@users.noreply.github.com>
1 parent 79e2df6 commit 46b7214

File tree

3 files changed

+388
-180
lines changed

3 files changed

+388
-180
lines changed

src/components/AutoBot/index.tsx

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,33 @@ SHAFT is an award-winning, all-in-one test automation framework that:
3434
- Has 40,000+ active users worldwide
3535
3636
CRITICAL RULES - You MUST follow these strictly:
37-
1. ONLY use information from these verified sources:
38-
- SHAFT official documentation: https://shafthq.github.io
39-
- SHAFT GitHub repository: https://github.com/shafthq/SHAFT_ENGINE
40-
2. DO NOT fetch or reference code from any other internet sources
41-
3. DO NOT make up information, features, or capabilities that are not documented
42-
4. DO NOT be creative with answers - stick to factual, documented information only
43-
5. If you don't have verified information about something, you MUST say:
44-
"I don't have verified information about this in SHAFT's official documentation. Please check:
45-
- Documentation: https://shafthq.github.io
46-
- GitHub Issues: https://github.com/shafthq/SHAFT_ENGINE/issues
47-
- GitHub Discussions: https://github.com/shafthq/SHAFT_ENGINE/discussions"
37+
1. BEFORE responding to ANY question, you MUST search your knowledge of the full official SHAFT user guide at https://shaftengine.netlify.app/ to find relevant information.
38+
2. ONLY use information from these verified sources:
39+
- SHAFT official user guide: https://shaftengine.netlify.app/ (PRIMARY SOURCE - search this first)
40+
- SHAFT GitHub repository: https://github.com/shafthq/SHAFT_ENGINE (for source code only)
41+
3. DO NOT fetch or reference code from any other internet sources
42+
4. DO NOT make up information, features, or capabilities that are not documented
43+
5. DO NOT be creative with answers - stick to factual, documented information only
44+
6. ALWAYS share exact links to your sources when providing information
45+
7. THINK THOROUGHLY before answering - take your time to validate information
46+
8. ALWAYS validate information from multiple sections of the documentation if possible
47+
9. When you are NOT 90% or more confident in your answer, you MUST mention your approximate certainty level (e.g., "I'm approximately 70% confident that...")
48+
10. If you don't have verified information about something, you MUST say:
49+
"I don't have verified information about this in SHAFT's official documentation. Please check:
50+
- User Guide: https://shaftengine.netlify.app/
51+
- GitHub Issues: https://github.com/shafthq/SHAFT_ENGINE/issues
52+
- GitHub Discussions: https://github.com/shafthq/SHAFT_ENGINE/discussions"
4853
4954
When answering questions:
50-
1. Be concise and provide only verified information
51-
2. Provide code examples ONLY if they exist in official documentation or repository (use proper Java syntax)
52-
3. Always reference the official documentation at https://shafthq.github.io
53-
4. Suggest checking the GitHub repository at https://github.com/ShaftHQ/SHAFT_ENGINE for source code
54-
5. Be friendly but prioritize accuracy over appearing helpful
55-
6. Never guess or speculate - if unsure, admit it and point to official resources
55+
1. FIRST, search the entire user guide at https://shaftengine.netlify.app/
56+
2. Be thorough and deliberate in your research before responding
57+
3. Provide code examples ONLY if they exist in official documentation or repository (use proper Java syntax)
58+
4. ALWAYS include the exact link to the relevant page in the user guide where you found the information
59+
5. For source code references, provide the exact GitHub URL to the relevant file or line
60+
6. If information comes from multiple pages, cite all relevant sources
61+
7. Be friendly but prioritize accuracy over appearing helpful
62+
8. Never guess or speculate - if unsure, admit it and state your confidence level
63+
9. Take time to validate your answer before providing it
5664
5765
Focus on helping users with:
5866
- Getting started with SHAFT
@@ -63,7 +71,12 @@ Focus on helping users with:
6371
- Understanding SHAFT features and capabilities
6472
- Differences between SHAFT and native Selenium/Appium
6573
66-
Remember: Accuracy is more important than appearing knowledgeable. When in doubt, direct users to official resources.`;
74+
Remember:
75+
- Accuracy is more important than appearing knowledgeable
76+
- Always cite your exact sources with links
77+
- Think carefully and validate before answering
78+
- State your confidence level if less than 90% certain
79+
- The official user guide at https://shaftengine.netlify.app/ is your PRIMARY source`;
6780

6881
const scrollToBottom = () => {
6982
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
@@ -152,7 +165,7 @@ Remember: Accuracy is more important than appearing knowledgeable. When in doubt
152165
console.error('[AutoBot] Error calling Gemini API:', error);
153166
const errorMessage: Message = {
154167
role: 'assistant',
155-
content: (error as Error).message || 'Sorry, I encountered an error. Please try again or check the documentation at https://shafthq.github.io',
168+
content: (error as Error).message || 'Sorry, I encountered an error. Please try again or check the user guide at https://shaftengine.netlify.app/',
156169
timestamp: new Date(),
157170
};
158171
setMessages((prev) => [...prev, errorMessage]);

src/components/AutoBot/styles.module.css

Lines changed: 105 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,22 +367,121 @@
367367

368368
/* Responsive Design */
369369
@media (max-width: 768px) {
370+
.autoBotContainer {
371+
bottom: 16px;
372+
right: 16px;
373+
}
374+
375+
.chatButton {
376+
width: 56px;
377+
height: 56px;
378+
}
379+
370380
.chatWindow {
381+
position: fixed;
371382
width: 100vw;
372-
height: 100vh;
373383
border-radius: 0;
374384
bottom: 0;
375385
right: 0;
386+
left: 0;
387+
top: 0;
376388
}
377389

378-
.autoBotContainer {
379-
bottom: 16px;
380-
right: 16px;
390+
.chatHeader {
391+
padding: 12px 16px;
392+
}
393+
394+
.headerText h3 {
395+
font-size: 16px;
396+
}
397+
398+
.statusIndicator {
399+
font-size: 11px;
400+
}
401+
402+
.chatMessages {
403+
padding: 12px;
404+
/* Ensure proper scrolling on mobile */
405+
-webkit-overflow-scrolling: touch;
406+
}
407+
408+
.messageContent {
409+
max-width: 90%;
410+
}
411+
412+
.messageBubble {
413+
padding: 8px 12px;
414+
font-size: 14px;
415+
}
416+
417+
.messageBubble p {
418+
font-size: 14px;
419+
}
420+
421+
.chatInput {
422+
padding: 10px 12px;
423+
}
424+
425+
.inputField {
426+
font-size: 16px; /* Prevents zoom on iOS */
427+
padding: 8px 10px;
428+
}
429+
430+
.sendButton {
431+
width: 36px;
432+
height: 36px;
433+
}
434+
435+
.chatFooter {
436+
padding: 6px 12px;
437+
font-size: 10px;
381438
}
382439

440+
/* Improve touch targets */
441+
.iconButton {
442+
width: 36px;
443+
height: 36px;
444+
min-width: 36px;
445+
min-height: 36px;
446+
}
447+
}
448+
449+
/* Additional mobile optimization for smaller screens */
450+
@media (max-width: 480px) {
383451
.chatButton {
384-
width: 56px;
385-
height: 56px;
452+
width: 50px;
453+
height: 50px;
454+
}
455+
456+
.badge {
457+
font-size: 9px;
458+
padding: 2px 5px;
459+
}
460+
461+
.headerIcon {
462+
font-size: 20px;
463+
}
464+
465+
.headerText h3 {
466+
font-size: 15px;
467+
}
468+
469+
.messageAvatar {
470+
width: 28px;
471+
height: 28px;
472+
font-size: 14px;
473+
}
474+
475+
.messageBubble {
476+
padding: 7px 10px;
477+
}
478+
479+
.messageBubble p {
480+
font-size: 13px;
481+
}
482+
483+
.messageTime {
484+
font-size: 9px;
386485
}
387486
}
388487

0 commit comments

Comments
 (0)