Skip to content

resolve TypeScript and Rust warnings#6612

Merged
louis-jan merged 8 commits into
janhq:devfrom
github-roushan:resolve-warnings
Oct 1, 2025
Merged

resolve TypeScript and Rust warnings#6612
louis-jan merged 8 commits into
janhq:devfrom
github-roushan:resolve-warnings

Conversation

@github-roushan

@github-roushan github-roushan commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

Describe Your Changes

  • Fixed syntax error with duplicate closing bracket in scrollToBottom useCallback
  • Added missing dependencies to all useCallback and useEffect hooks to resolve "Cannot find name" TypeScript errors
  • Updated dependency arrays for handleScroll, checkScrollState, and all useEffect hooks to include all referenced variables
  • fixed RUST warnings related to unused imports

Fixes Issues

  • Closes #N/A

Self Checklist

  • [] Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Fix warnings by removing unused code, adding missing dependencies, and renaming types for consistency.

  • Code Cleanup:
    • Remove unused connectTimeout option in handleStreamingResponse() in index.ts.
    • Add missing imports for Duration and timeout in graceful_terminate_process() in process.rs.
    • Comment out unused import CommandExt in setup_windows_process_flags() in system.rs.
  • Renaming:
    • Rename type definitions in amd.rs for consistency (e.g., ADL_MAIN_MALLOC_CALLBACK to AdlMainMallocCallback).
  • React Hook:
    • Add scrollContainerRef to dependency arrays in useEffect hooks in useThreadScrolling.tsx to fix missing dependency warnings.

This description was created by Ellipsis for 7760eb3. You can customize this summary. It will automatically update as commits are pushed.

@github-roushan github-roushan marked this pull request as ready for review September 26, 2025 09:51

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 7760eb3 in 2 minutes and 27 seconds. Click for details.
  • Reviewed 173 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 7 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src-tauri/utils/src/system.rs:37
  • Draft comment:
    Raw string literal used for UNC prefix trimming ends with a backslash and may trigger warnings. Consider replacing it with an escaped literal (e.g., "\\?\") to avoid potential issues.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. web-app/src/hooks/useThreadScrolling.tsx:165
  • Draft comment:
    The debounced scroll handler is created without an explicit delay and isn’t memoized. Consider using useMemo (and providing a delay) to ensure a stable function reference across renders.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. src-tauri/plugins/tauri-plugin-hardware/src/vendor/amd.rs:186
  • Draft comment:
    The return value of AdlAdapterActiveGet is not checked. It’s good practice to verify its success to ensure reliable detection of the active adapter.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% The code was changed to rename the function from adl_adapter_active_get to AdlAdapterActiveGet. The underlying behavior and error handling hasn't changed. The code seems to work fine without checking the return value - if there was an error, is_active would likely remain 0 and that adapter would be skipped. The function is part of a larger error-handling context where the main initialization is checked. I might be underestimating the importance of checking error codes from AMD's driver API. An error here could indicate a more serious problem that should be logged. While checking error codes is generally good practice, this is a non-critical GPU monitoring function where skipping problematic adapters is a reasonable fallback. The code already has error handling around the critical operations. While the comment makes a valid point about best practices, it's not critical enough to warrant keeping given our rules about only making essential comments.
4. src-tauri/plugins/tauri-plugin-hardware/src/vendor/amd.rs:132
  • Draft comment:
    Typo: 'AdlAdapterNumberofadaptersGet' is inconsistent in its camel casing. Consider renaming it to 'AdlAdapterNumberOfAdaptersGet' for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment is technically correct - the casing is inconsistent with 'of' being lowercase while other words are capitalized. However, this appears to be part of a larger renaming effort where the code is being changed to match the actual DLL function names. The type name matches the function name it's binding to ('AdlAdapterNumberofadaptersGet'). Changing the casing would make it mismatch the actual function name. The comment fails to recognize that this type name needs to match the external DLL function name. Changing the casing could cause confusion or bugs. While consistent casing is generally good practice, in this case the type name should match the external function name it's binding to, even if that name has inconsistent casing. The comment should be deleted because it suggests a change that would make the code less accurate by making it mismatch the external DLL function name it's binding to.
5. src-tauri/plugins/tauri-plugin-hardware/src/vendor/amd.rs:133
  • Draft comment:
    Typo: 'AdlAdapterAdapterinfoGet' should likely be 'AdlAdapterAdapterInfoGet' to maintain consistent camel case formatting.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The type name needs to match the actual symbol name in the ADL library. The symbol is loaded using lib.get(b"AdlAdapterAdapterinfoGet"), so changing the type name would need to match the actual DLL symbol name. We don't have evidence that the DLL uses that symbol name. Making the type name more consistent but different from the actual symbol name could be confusing. The comment assumes we should prioritize Rust naming conventions over matching the external C library's symbol names. This could make the code harder to maintain by creating a mismatch between type names and symbol names. While consistent casing is good, in FFI code it's more important to match the external library's naming. Without evidence of the actual DLL symbol name, suggesting a rename could cause issues. Delete the comment. When dealing with FFI bindings, type names should match the external library's symbol names rather than following Rust conventions. We don't have evidence that the suggested name is correct.
6. src-tauri/plugins/tauri-plugin-hardware/src/vendor/amd.rs:165
  • Draft comment:
    Typo found: The comment currently reads "whenver we encounter an error". Please correct "whenver" to "whenever".
  • Reason this comment was not posted:
    Comment was on unchanged code.
7. src-tauri/plugins/tauri-plugin-hardware/src/vendor/amd.rs:205
  • Draft comment:
    Typo: The function name 'adlmaincontroldestroy' seems to be misspelled. It should likely be 'adl_main_control_destroy' to match the earlier naming convention.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_ezzkCGsq0Gj2ukoZ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@github-roushan

Copy link
Copy Markdown
Contributor Author

@dinhlongviolin1
As u have update the file useThreadScrolling.tsx. I am adding you to review

@github-roushan github-roushan changed the title chore: fix warnings resolve TypeScript and Rust warnings Sep 26, 2025
Comment thread extensions/llamacpp-extension/src/index.ts
Comment thread src-tauri/utils/src/system.rs Outdated
@louis-jan louis-jan requested a review from Copilot September 29, 2025 03:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes TypeScript and Rust warnings by cleaning up unused imports, adding missing dependencies to React hooks, and resolving syntax errors.

  • Fixed React hook dependency arrays to include all referenced variables
  • Removed unused imports and options in Rust and TypeScript code
  • Added missing imports where needed to resolve compilation warnings

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
web-app/src/hooks/useThreadScrolling.tsx Added missing dependencies to useCallback and useEffect hooks
src-tauri/utils/src/system.rs Commented out unused CommandExt import
src-tauri/plugins/tauri-plugin-llamacpp/src/process.rs Moved Duration and timeout imports to proper scope
extensions/llamacpp-extension/src/index.ts Removed unused connectTimeout option

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src-tauri/utils/src/system.rs Outdated
@louis-jan

Copy link
Copy Markdown
Contributor

Hi @github-roushan, we’re eager to get this PR merged. Would you mind helping to address the comments mentioned earlier?

@github-roushan

Copy link
Copy Markdown
Contributor Author

Hi @github-roushan, we’re eager to get this PR merged. Would you mind helping to address the comments mentioned earlier?

@louis-menlo Done

@louis-jan louis-jan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louis-jan

Copy link
Copy Markdown
Contributor

Awesome! Thanks @github-roushan

@louis-jan louis-jan merged commit 247db95 into janhq:dev Oct 1, 2025
21 of 24 checks passed
@github-project-automation github-project-automation Bot moved this to QA in Jan Oct 1, 2025
@github-roushan github-roushan deleted the resolve-warnings branch October 1, 2025 09:10
louis-jan pushed a commit that referenced this pull request Oct 6, 2025
* feat: Init mobile app from current Tauri v2 framework

Feat:
- Using Tauri v2 by default
- Add new configuration to initiate mobile app
- Add dependencies needed for mobile build
Test:
- Confirm to be built successfully
- Confirm to keep settings for desktop and build successfully
- Reuse most of components from desktop version

* fix: Fix tests

* feat: Add android target

* fix: Reconfigure and add toolchain to wake up Android app

* fix: Fix parsing datatype inconsistent across platforms

* feat: Adjust UI for mobile res

Feature:
- Adjust homecreen and chatscreen for mobile device
- Fix tests for both FE and BE
Self-test:
- Confirm runnable on both Android and iOS
- Confirm runnable on desktop app
- All test suites passed
- Working with ChatGPT API

* fix: Restore dedupe command

* chore: Adjust paddings to save some space for the top nav bar

* Update web-app/src/routes/index.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* chore: keep gen icon on Android

* chore: add command to ease the mobile dev

* chore: Separate configuration for android build in release mode

* chore: Shrink the Android app size to minimal, release type

* feat: Disable zoom and setup mobile viewport

* chore: Configure iOS to use the same build mechanic to remove unnecessary plugin

* fix: Remove redundant yarn command for ios dev build

* enhancement: fit mobile layout

* chore: update chatscreen padding

* chore: update checking platform using config isntead navigation agent

* chore: update height of thread detail

* remove gen android

* Update web-app/src/index.css

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix: Add frontendDist to ios configuration

* feat: Experiment removing hardware permission

* fix: Android releasable build

* feat: Add dev-android to makefile

* feat: Add dev-ios to makefile for ios development

* refactor(utils): add helper to remove extensions from file paths

* chore: fix Encoded logging

* refactor: safely strip prefix and extensions from filename

* chore: add logging for TauriDialog Service

* Update handbook content with Nextra callout and content improvements

- Convert blockquote to Nextra callout in open-superintelligence.mdx
- Add Edison link and improve content flow
- Refine language for better clarity

* docs: enhance overview page with improved structure and internal linking

- Restructured main content with cleaner formatting
- Added comprehensive internal linking for better navigation
- Improved visual hierarchy and readability
- Enhanced acknowledgements section with better organization
- Updated product suite section with consistent formatting

* Update handbook navigation structure and meta.json files

- Updated handbook/_meta.json to properly organize navigation
- Fixed duplicate entries by removing files that belong in subfolders
- Updated why folder title to 'Why does Jan exist?'
- Cleaned up why/_meta.json with proper titles for Open Superintelligence and Open-Source sections

* docs: fix broken internal links and remove privacy page

- Fix broken links in troubleshooting.mdx pointing to install pages
- Remove privacy.mdx page and update _meta.json navigation
- Update various documentation links for consistency
- Ensure all internal links use proper absolute paths

* Optimize installation pages SEO meta titles and descriptions

✨ SEO Improvements:
- Mac: 'Run AI models locally on your Mac - Jan'
- Linux: 'Run AI models locally on Linux - Jan'
- Windows: 'Run AI models locally on Windows - Jan'

🎯 Meta descriptions now include:
- Target keywords (local AI, LLM, offline, ChatGPT-like)
- Platform-specific details (Apple Silicon, Ubuntu/Debian, Windows 10/11)
- Key benefits (GPU acceleration, privacy, no internet required)

📍 Sidebar navigation titles unchanged - only SEO meta data optimized

* Clean up installation page titles and descriptions

- Revert titles to clean sidebar navigation (Mac, Linux, Windows)
- Improve meta descriptions to be concise but SEO-friendly
- Keep key terms: local AI, offline, GPU acceleration, platform details

* Update README.md

* Update README.md

* trigger PR banner

* docs: update missing redirect links

* enhancement: social media navbar and update menu footer

* Update docs/src/components/Navbar.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/src/components/Navbar.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: Apply model name change correctly

# Conflicts:
#	web-app/src/lib/utils.ts

* feat: Disable text selection on Toaster

Disable the option to select text on the Toaster to consist the swiping action on the toast in order to dismiss it

* fix: scroll issue padding not re render correctly (#6639)

* trigger PR banner

* Improve FAQ section and content updates for offline ChatGPT alternative post

* Add SEO-optimized Twitter meta titles for installation pages

- Add Twitter meta tags to Windows, Linux, and Mac installation pages
- Optimize meta titles: 'Jan on [Platform]' for better SEO
- Maintain consistent meta descriptions across all platforms
- Keep original page titles unchanged for user experience

* Update content files

- Update tabby server example
- Update troubleshooting documentation
- Update NVIDIA TensorRT-LLM benchmarking post

* Add ChatGPT alternative blog post and update installation docs

* Update ChatGPT alternative blog post

* Rename blog post from chatgpt-alternative-jan.mdx to chatgpt-alternatives.mdx

* feat: add real-time ChatGPT status checker blog post

- Add new blog post: 'is-chatgpt-down-use-jan'
- Create OpenAIStatusChecker React component with real-time data
- Use CORS proxy to fetch live OpenAI status from status.openai.com
- Include SEO-optimized status indicators and error messages
- Add ChatGPT downtime promotion for Jan alternative
- Component features: auto-refresh, fallback handling, dark mode support

* chore: fix typo

* chore: fix failed build

* refactor: deprecate Vulkan external binaries (#6638)

* refactor: deprecate vulkan binary

refactor: clean up vulkan lib

chore: cleanup

chore: clean up

chore: clean up

fix: build

* fix: skip binaries download env

* Update src-tauri/utils/src/system.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src-tauri/utils/src/system.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: Add tests for the model displayName modification

* fix: Fix linter error

* fix: Fix nvidia and vulkan after upgrade to be compatible with mobile compiling too

* Fix OG image paths and move images to general folder

- Move OG images from _assets/ to public/assets/images/general/
- Update all blog post references to use correct paths
- Remove duplicate images from _assets/ folder
- Fix image paths in content to use /assets/images/general/ format
- Update Twitter image references to match OG image paths

Files updated:
- chatgpt-alternatives.mdx
- deepresearch.mdx
- deepseek-r1-locally.mdx
- how-we-benchmark-kernels.mdx
- is-chatgpt-down-use-jan.mdx
- offline-chatgpt-alternative.mdx
- qwen3-settings.mdx
- run-ai-models-locally.mdx
- run-gpt-oss-locally.mdx

* fix: remove Jan prefix from blog post titles for better SEO

- Blog posts now use only frontmatter title without 'Jan -' prefix
- Other pages maintain existing branding (Jan Desktop, Jan Server, Jan)
- Improves SEO for blog content while preserving site branding

* update blog post content

* Feat: web temporary chat (#6650)

* temporray chat stage1

* temporary page in root

* temporary chat

* handle redirection properly
`

* temporary chat header

* Update extensions-web/src/conversational-web/extension.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update routetree

* better error handling

* fix strecthed assitant on desktop

* update yarn link to workspace for better link consistency

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add Guides category to blog navigation

- Add 'guides' category to staticCategories array in Blog component
- Update plopfile.js to include guides in category choices
- Add guides category entry to _meta.json
- Position guides category after research in navigation

* docs: update redirect links

* Update AI for Law blog post with images and content improvements

- Add hero image for AI for Law blog post
- Add images to assistant creation and contract review sections
- Improve content structure and readability
- Add proper image assets for legal AI use cases
- Update ogImage and twitter image references

* fix: revert the modification of vulkan

* Add AI for Teachers blog post with images and video

- Create comprehensive AI for Teachers blog post
- Add hero image and assistant creation interface images
- Include video demonstration of Jan for teachers
- Add proper ogImage and twitter image references
- Cover lesson planning, grading, parent communication, and classroom resources
- Focus on privacy and offline AI for educational use

* fix: Fix linter and tests

* fix: Restore default permission on desktop build

Restore desktop capabilities
Restore linter correctness
Restore different capabilities on each platform

* fix: Fix cargo test

* feat: web add search button for extension (#6671)

* add search button for web extension

* change button color and behavior

* Update extensions-web/src/mcp-web/components/WebSearchButton.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* add eof new line missing (#6673)

* fix lint issue

* fix: mcp bin path (#6667)

* fix: mcp bin path

* chore: clean up unused structs

* fix: bin name

* fix: tests

* remove test conflict

* add missing closing test

* fix tauri test

* feat: disable all web mcp by default (new users) (#6677)

* fix: chat completion usage - token speed (#6675)

* resolve TypeScript and Rust warnings (#6612)

* chore: fix warnings

* fix: add missing scrollContainerRef dependencies to React hooks

* fix: typo

* fix: remove unsupported fetch option and enable AsyncIterable types

- Removed `connectTimeout` from fetch init (not supported in RequestInit)
- Updated tsconfig to target ES2018

* chore: refactor rename

* fix(hooks): update dependency arrays for useThreadScrolling effects

* Add type.d.ts to extend requestinit with connectionTimeout

* remove commentd unused import

* fix: Fix editing model without saving should restore original name

* fix: thread item overfetching (#6699)

* fix: thread item overfetching

* chore: cleanup left over import

* feat: improve projects (#6698)

* decouple successfully

* only show movable projects for project items

* handle delete covnersations when projects is removed

* fix leftpanel assignemtn

* fix lint

* fix gg tag (#6702)

* refactor: resolve rust analyzer warnings and improve code quality (#6696)

- Update string formatting to use modern interpolation syntax
- Simplify expressions and remove unnecessary intermediate variables
- Improve logging statements for better readability
- Clean up code across core modules (app, downloads, mcp, server, etc.)

* docs: add Jan v0.7.0 changelog

* docs: update Jan v0.7.0 changelog content

* docs: rename changelog file to remove trailing dash

* feat: use sql for mobile storage

* feat: organize code for proper import

Move platform checker for db access to helper
Add test for to threads controller

* feat: better structure for MobileCoreService

MobileCoreService should inherit TauriCoreService to match Tauri architecture patterns

* fix: Extract model capabilities correctly for various providers on various platforms

* fix: yarn lint

* ci: remove upload msi

* fix: extensions missing on Unix dev (#6724)

* fix: extensions missing on Unix dev

* re add bun uv for mcp

* fix: Local API Server - disable settings on run (#6707)

* fix: Fix tests in threads with proper mock folder properly

* changelog: release 0.7.1

* chore: wrong version in detail changelog

* fix: update detail changelog 0.7.1

* fix(ui): restore missing border on model selector (#6692)

* fix: Fix openssl issue on mobile after merging

* fix: Remove yarn.lock changes

* chore(ui): refine className for dropdown menu with animation states

* chore: Reposition 'Remove project' option for better usability

* feat: add project search and scrollable thread lists

- Add search bar to filter projects by name in real-time
- Implement scrollable thread container with max 4 visible threads
- Add empty state for no search results
- Add clear button (X) to reset search query

* (chore): rename translation keys to collapseProject/expandProject

* Fix Translation changes across locales

* (chore): remove duplicate keys from de-DE/common.json

* Add SearchProjects to missing locales

* fix: theme native system and check os support blur

* fix: new window theme

* fix: open new window theme

* fix: test use case appearance

* chore: fix window type theme service

* chore: update permission windows

* chore: fix desktop capabilities

* chore: check support blur using hardware api

* chore: check support blur on FE

* chore: fix new chat with update last selected model dropdown

* fix: tittle recent when no result found

---------

Co-authored-by: Vanalite <dhnghia0604@gmail.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Faisal Amir <urmauur@gmail.com>
Co-authored-by: Roushan Singh <github.rtron18@gmail.com>
Co-authored-by: eckartal <emre@jan.ai>
Co-authored-by: Emre Can Kartal <159995642+eckartal@users.noreply.github.com>
Co-authored-by: Roushan Kumar Singh <158602016+github-roushan@users.noreply.github.com>
Co-authored-by: Nguyen Ngoc Minh <91668012+Minh141120@users.noreply.github.com>
Co-authored-by: Minh141120 <minh.itptit@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Dinh Long Nguyen <dinhlongviolin1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

3 participants