Skip to content

fix(chat): restore focus to chat input after closing keyboard shortcuts modal - #823

Closed
kareena0229 wants to merge 892 commits into
param20h:devfrom
kareena0229:feat-keyboard-shortcuts-chat
Closed

kareena0229 wants to merge 892 commits into
param20h:devfrom
kareena0229:feat-keyboard-shortcuts-chat

Conversation

@kareena0229

Copy link
Copy Markdown
Contributor

Related Issue

Closes #821

Summary

This PR improves keyboard accessibility by automatically restoring focus to the chat input after the Keyboard Shortcuts help modal is closed.

Users can now continue typing immediately without needing to manually click the input field.

Changes Made

  • Added a reusable closeHelpModal helper.
  • Restores focus to the chat input using textareaRef.current?.focus().
  • Preserves focus restoration regardless of how the modal is dismissed:
  1. Close button (×)
  2. Clicking outside the modal
  3. Pressing Esc
  • Keeps existing modal behavior unchanged.

Why This Change?

Previously, closing the Keyboard Shortcuts modal left keyboard focus undefined, requiring keyboard users to manually click the chat input before continuing.

This update provides a smoother and more accessible keyboard workflow while following common focus management practices.

Testing

  • ✅ Modal closes via close button and focus returns to the chat input.

  • ✅ Modal closes by clicking outside and focus returns to the chat input.

  • ✅ Modal closes using the Esc key and focus returns to the chat input.

  • ✅ Existing chat functionality remains unaffected.

  • ✅ npm run build passes.

  • ✅ npm run lint completes with no errors related to this change.

  • ☑️ I have tested my changes locally.

  • ☑️ My code follows the project's coding style.

  • ☑️ This PR addresses issue [Enhancement] Restore Keyboard Focus to Chat Input After Closing Keyboard Shortcuts Modal #821.

nancysangani and others added 30 commits June 8, 2026 13:16
- models.py: restore filename index=True + add upstream processing columns
  (processing_progress, processing_stage, retry_count, last_error_traceback,
  processing_started_at, completed_at, extracted_urls) alongside feature's
  keywords column
- agent.py: restore ChatHuggingFace + ExternalServiceException from upstream;
  keep feature's extract_keywords import and persist_document_keywords helper;
  restore chat_llm agent setup and proper error raising
- requirements.txt: restore google-auth-oauthlib to Auth section,
  unstructured[pdf] to Document Processing, redis>=4.6.0 at bottom;
  remove duplicate fastapi-mail
- tests/test_documents.py: fix assertion to use correct FastAPI detail key
  and matching substring 'not supported'
…action-tags

# Conflicts:
#	backend/app/models.py
#	backend/app/schemas.py
#	backend/app/services/document_ingestion.py
Signed-off-by: Garima Varshney <gungunvarshney00@gmail.com>
# Conflicts:
#	backend/app/routes/chat.py
#	backend/app/routes/documents.py
#	backend/requirements.txt
#	frontend/e2e/auth-and-chat.spec.ts
- Add dedicated FIELD_ENCRYPTION_KEY setting (separate from SECRET_KEY)
- Update EncryptedString to use FIELD_ENCRYPTION_KEY with key versioning
- Add JWT algorithm whitelist enforcement (HS256 only)
- Add production validation to reject default SECRET_KEY and empty
  FIELD_ENCRYPTION_KEY
- Add DOC_CLEANUP_INACTIVE_DAYS and DOC_CLEANUP_ENABLED settings

Closes param20h#513
- Remove redundant asyncio-based document_cleanup_job() from main.py
- Add unified cleanup_inactive_active_documents() with batched pagination
- Add _hard_delete_document() helper with per-document error isolation
- Add advisory_lock() helper for PostgreSQL/SQLite coordinated cleanup
- Schedule inactive-active cleanup via APScheduler alongside existing jobs
- Use batched pagination (100 docs/batch) in all cleanup functions

Closes param20h#514
- Remove dead root-level Flask files: app.py, models.py, config.py,
  make_admin.py, requirements.txt, start.sh
- Remove legacy static/ and instance/ directories
- Update README.md Tech Stack to reflect FastAPI/Next.js/ChromaDB/
  HuggingFace stack
- Consolidate .env.example to match backend/app/config.py settings
- Add FIELD_ENCRYPTION_KEY, DOC_CLEANUP_*, and workspace settings to
  .env.example

Closes param20h#515
…anching

feat: add conversation branching foundation
NaitikVerma6776 and others added 24 commits June 25, 2026 12:07
…t-unit-scaling

fix: scale PDF-unit highlight rects by zoom level to prevent misalignment
…badge

feat: per-message response time badge
feat(rag): add OCR fallback for image-based PDF pages
…missing-page

fix: gracefully handle missing/invalid page metadata in SourceCard
Frontend is now hosted separately on Vercel.
Backend on Hugging Face serves only the FastAPI API.
@kareena0229
kareena0229 requested a review from param20h as a code owner July 9, 2026 21:40
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@kareena0229 is attempting to deploy a commit to the param20h's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Restore Keyboard Focus to Chat Input After Closing Keyboard Shortcuts Modal