Skip to content
Merged

aWd #75

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/comment-run-enhanced-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
LLM_PROVIDER: gemini
DISABLE_IMG_AS: "true"
run: |
args="${{ steps.parse.outputs.args }}"
if [ -n "$args" ]; then
Expand All @@ -144,6 +145,10 @@ jobs:
AutoSnap/changed-files-*.txt
AutoSnap/api_logs/
AutoSnap/screenshots/
docs/**/img_as/**
spanish/**/img_as/**
docs/**/img/**
spanish/**/img/**
if-no-files-found: ignore

- name: Get PR head info
Expand Down Expand Up @@ -172,12 +177,22 @@ jobs:
set -e
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Stage only image files under AutoSnap/screenshots
# Stage images from common output locations
if [ -d AutoSnap/screenshots ]; then
find AutoSnap/screenshots -type f \
\( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.webp' -o -iname '*.gif' \) -print0 \
| xargs -0 -r git add --
fi
if [ -d docs ]; then
find docs -type f \( -path '*/img_as/*' -o -path '*/img/*' \) \
\( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.webp' -o -iname '*.gif' \) -print0 \
| xargs -0 -r git add --
fi
if [ -d spanish ]; then
find spanish -type f \( -path '*/img_as/*' -o -path '*/img/*' \) \
\( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.webp' -o -iname '*.gif' \) -print0 \
| xargs -0 -r git add --
fi
if git diff --staged --quiet; then
echo "No screenshots to commit."
exit 0
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ AutoSnap/test_workflow.py
!docs/**/*.ico
!docs/**/*.webp

# Allow images in spanish folder
!spanish/**/*.png
!spanish/**/*.jpg
!spanish/**/*.jpeg
!spanish/**/*.gif
!spanish/**/*.bmp
!spanish/**/*.svg
!spanish/**/*.ico
!spanish/**/*.webp

# Allow images in specific image folders
!static/img/**

Expand Down
4 changes: 4 additions & 0 deletions AutoSnap/tracewrightt/src/ai_utils_enhanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export class AIUtilsEnhanced {
* Get the img_as folder path for the current markdown file
*/
public getImgAsPath(): string | null {
// Allow disabling img_as behavior entirely via env flag
if (process.env.DISABLE_IMG_AS === 'true') {
return null;
}
if (!this.currentMdPath) {
return null;
}
Expand Down
4 changes: 3 additions & 1 deletion AutoSnap/tracewrightt/src/screenshot_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export async function forceScreenshotWithRetries(cmd: string, page: Page, aiUtil
console.log(`🔍 Current MD path: ${currentMdPath}`);
console.log(`🔍 Img_as path: ${imgAsPath}`);

if (currentMdPath && imgAsPath && pathMatch) {
// Respect DISABLE_IMG_AS flag
const disableImgAs = process.env.DISABLE_IMG_AS === 'true';
if (currentMdPath && imgAsPath && pathMatch && !disableImgAs) {
const originalPath = pathMatch[1];

// Only modify if the path is not already absolute
Expand Down
1 change: 1 addition & 0 deletions spanish/6-Image-Viewer/4_MoreOptionsToolbarMenu.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Permite alterar as configurações do Visualizador de Imagens para várias categ
- **Finalidade:** Controla a visibilidade do menu do viewport.
- **Funcionalidade:** Os usuários podem ativar ou desativar esta configuração para ocultar ou mostrar automaticamente o menu do viewport, proporcionando um espaço de trabalho mais limpo. Quando ativada, o menu permanece oculto até que o usuário interaja com ele.


![More%20Settings.png](./img/More%20Settings.png)

**Abrir em Janela Separada**
Expand Down