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

Fix issue #5343: [Bug]: Frontend changes cause Python unit tests workflow to fail but not frontend workflow #5344

Closed
wants to merge 1 commit into from
Closed
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
33 changes: 33 additions & 0 deletions .github/workflows/frontend-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint Frontend

on:
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/frontend-lint.yml'
push:
branches:
- main
paths:
- 'frontend/**'
- '.github/workflows/frontend-lint.yml'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: cd frontend && npm ci

- name: Run TypeScript type checking
run: cd frontend && npx tsc --noEmit

- name: Run ESLint and Prettier
run: cd frontend && npm run lint
33 changes: 33 additions & 0 deletions .github/workflows/frontend-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Frontend Tests

on:
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/frontend-test.yml'
push:
branches:
- main
paths:
- 'frontend/**'
- '.github/workflows/frontend-test.yml'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: cd frontend && npm ci

- name: Run TypeScript type checking
run: cd frontend && npx tsc --noEmit

- name: Run tests
run: cd frontend && npm run test
7 changes: 4 additions & 3 deletions frontend/src/components/chat-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export function ChatInput({
};

const handleSubmitMessage = () => {
if (textareaRef.current?.value) {
onSubmit(textareaRef.current.value);
textareaRef.current.value = "";
const textarea = textareaRef.current;
if (textarea?.value) {
onSubmit(textarea.value);
textarea.value = "";
}
};

Expand Down
Loading