Skip to content

Comments

ci: add typecheck job and simplify npm scripts#218

Merged
TalexDreamSoul merged 7 commits intomasterfrom
fix/2.4.7-251129
Nov 29, 2025
Merged

ci: add typecheck job and simplify npm scripts#218
TalexDreamSoul merged 7 commits intomasterfrom
fix/2.4.7-251129

Conversation

@TalexDreamSoul
Copy link
Contributor

@TalexDreamSoul TalexDreamSoul commented Nov 29, 2025

Summary by CodeRabbit

Release Notes

Improvements

  • Enhanced clipboard and paste functionality with improved state management and auto-fill behavior
  • Refined search experience with better recommendation logic and provider handling
  • Optimized keyboard navigation and interaction flow
  • Strengthened CI/CD pipeline with automated type checking
  • Streamlined build command structure for development workflow

✏️ Tip: You can customize this high-level summary in your review settings.

Adds a new 'typecheck' job to the CI pipeline to ensure TypeScript type safety for all pull requests.

Additionally, npm scripts in the root `package.json` have been refactored to remove the `core:` prefix, making them easier to run.
The handling of the Escape key has been refactored to follow a strict, sequential process, ensuring a more predictable and intuitive user experience.

The new exit sequence is as follows:
1. Deactivate any active providers.
2. Clear clipboard or file attachments.
3. Clear the search input query.
4. Hide the CoreBox window.

This change resolves an issue where the window could be hidden prematurely when the user's intent was merely to dismiss an attached item like a clipboard entry.

Additionally, extensive JSDoc comments have been added to the `useClipboard`, `useKeyboard`, and `useSearch` hooks, replacing inline comments to improve overall code clarity and maintainability.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Warning

Rate limit exceeded

@TalexDreamSoul has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cefac54 and 6aa357f.

📒 Files selected for processing (1)
  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts (9 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This PR introduces a CI typecheck job, simplifies npm scripts by removing the "core:" prefix, and refactors multiple renderer hooks to enhance clipboard management, keyboard handling, and search functionality with new state management methods.

Changes

Cohort / File(s) Summary
CI and build automation
.github/workflows/ci.yml, .github/workflows/build-and-release.yml, package.json
Added new job_typecheck CI job that runs PNPM typecheck after linting. Simplified npm scripts by removing "core:" prefix and consolidating into generic tasks (dev, build, build:beta, etc.). Updated build workflow to reference new simplified script names.
Clipboard state and interaction
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
Introduced normalizeTimestamp() helper and auto-paste cleanup functions. Expanded handleAutoFill() with explicit logic for file, text, and image handling. Refactored handlePaste() with timestamp normalization and refresh semantics. Added applyToActiveApp() and enhanced clearClipboard() with remember flag logic. Exposed five new public hook methods for external state control.
Keyboard event handling
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
Refactored ESC key flow into explicit sequential checks: exit providers, clear clipboard when in FILE mode, clear search query. Improved code clarity and separation of concerns.
Search initialization and provider management
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
Added explicit recommendation search path for empty queries. Consolidated provider deactivation with new deactivateAllProviders() function. Enhanced handleExit() with sequential mode transitions and window hiding. Improved handleExecute() with defensive guards and updated state broadcasting.
Logger formatting and initialization
apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
Added initialization guard in loadSettings to defer storage access. Minor formatting adjustments to conditionals and error handling with preserved semantics.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • useClipboard.ts: Dense refactoring with multiple new state paths (normalization, dismissal tracking, auto-fill branching). Verify timestamp handling, duplicate prevention via autoPastedTimestamps set, and interaction between clearClipboard() remember flag and lastClearedTimestamp logic.
  • useSearch.ts: New deactivateAllProviders() function and consolidated deactivation flow may affect provider lifecycle. Verify that recommendation initialization path triggers correctly on empty queries and that state transitions occur in proper sequence.
  • Integration between hooks: Verify that ESC key flow in useKeyboard correctly triggers clearClipboard() and mode transitions defined in useClipboard, and that search reset integrates with both keyboard and clipboard state.
  • CI typecheck job: Confirm that job_typecheck runs after job1 successfully and that frozen-lockfile constraint doesn't cause unexpected failures.

Possibly related PRs

Poem

🐰 A rabbit's whisper of these changes wise:
Clipboards now clean with remembered sighs,
ESC keys flow like streams so clear,
Search finds recommendations near and far,
Type-checked and swift, our builds take flight,
With simpler scripts—oh what a sight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a typecheck CI job and simplifying npm scripts by removing 'core:' prefix.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (5)
.github/workflows/ci.yml (1)

82-107: Typecheck job looks good overall.

The new CI job follows best practices: uses frozen lockfile, appropriate Node version matching volta.node in package.json, and aligns with the documented pnpm typecheck command from learnings.

Two minor observations:

  1. Inconsistent checkout version: This job uses actions/checkout@v4 while job2 (line 75) uses @v3. Consider updating job2 for consistency.

  2. Runs unconditionally: Unlike job2 which has if: ${{ always() && needs.job1.outputs.markdown_change == 'true' }}, this job runs on every PR. This is likely intentional for type safety, but worth confirming if you want to skip typecheck when only non-code files change.

apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts (2)

203-206: Mutating array length directly may cause reactivity issues.

Using searchResults.value.length = 0 mutates the array in place. In Vue 3 with ref, this should work, but reassigning is more idiomatic and explicit:

-      searchResults.value.length = 0
+      searchResults.value = []

360-368: deactivateAllProviders duplicates logic from deactivateProvider(undefined).

The body of deactivateAllProviders is identical to what deactivateProvider() does when called without arguments. Consider consolidating:

  async function deactivateAllProviders(): Promise<void> {
-   const newState = await touchChannel.send('core-box:deactivate-providers')
-   activeActivations.value = newState
-   searchVal.value = '' // Clear search input to clear item list
-   await handleSearch()
+   await deactivateProvider()
  }
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts (2)

84-90: Use console.debug instead of console.warn for diagnostic logging.

Per coding guidelines, use log4js with structured namespaces. At minimum, console.warn should be reserved for actual warnings. These are informational logs:

-    console.warn('[Clipboard] AutoPaste time check', {
+    console.debug('[Clipboard] AutoPaste time check', {

This applies to similar occurrences at lines 110, 137, 157, 169, 183, 221, 232, 307, and 315.


199-199: Synchronous IPC call may cause UI jank.

touchChannel.sendSync('clipboard:get-latest') blocks the renderer process. For clipboard operations that may involve file system or image processing, consider using async IPC:

-  function handlePaste(options?: { overrideDismissed?: boolean }): void {
+  async function handlePaste(options?: { overrideDismissed?: boolean }): Promise<void> {
     const overrideDismissed = options?.overrideDismissed ?? false
-    const clipboard = touchChannel.sendSync('clipboard:get-latest') as IClipboardItem | null
+    const clipboard = await touchChannel.send('clipboard:get-latest') as IClipboardItem | null

Note: This would require updating callers to handle the async return.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6bbf3 and 05c5156.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml (1 hunks)
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts (7 hunks)
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts (3 hunks)
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts (6 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
apps/core-app/src/renderer/src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/core-app/src/renderer/src/**/*.{ts,tsx,vue}: Implement Vue 3 components with TypeScript in the renderer process. Organize components in src/components/, view layouts in src/views/, and state management via Pinia stores and composables in src/modules/hooks/.
Use Pinia stores and composables in src/modules/hooks/ for state management in the renderer process instead of local component state.
Use Vue Router 4.5.1 for client-side routing in the renderer application.

apps/core-app/src/renderer/src/**/*.{ts,tsx,vue}: Use Pinia stores and composables in src/modules/hooks/ for state management in renderer process Vue components
Use Vue 3, TypeScript, Pinia for state management, and UnoCSS for styling in renderer process

Files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
apps/core-app/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/core-app/src/**/*.{ts,tsx}: Use log4js for logging with structured namespaces, timestamps, and colored output. Provide meaningful namespace identifiers for debugging.
Import and use shared types and utilities from @talex-touch/utils package. Use enums like TuffInputType, TalexEvents, and ChannelType from the shared package.

Files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
apps/core-app/src/renderer/src/**/*.{vue,ts,tsx,css,scss}

📄 CodeRabbit inference engine (CLAUDE.md)

Use UnoCSS 66.3.3+ for utility-first CSS styling instead of traditional CSS frameworks.

Files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
apps/core-app/src/renderer/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use Pinia 3.0.3 for state management in the renderer application.

Files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
apps/core-app/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Import shared types and utilities from @talex-touch/utils package in plugins and application code

Files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Execute type checking with `npm run typecheck` (main + renderer process) from apps/core-app/ directory
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Run `npm run typecheck` within apps/core-app/ for TypeScript validation. Use `npm run typecheck:node` for main process and `npm run typecheck:web` for renderer process validation.
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to **/plugins/**/*.{ts,tsx,js,jsx} : Use TuffInputType enum values (text, image, files, html) when handling clipboard data in plugins. Check query.inputs array to find specific input types and access their content and thumbnail properties.
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Applies to plugins/**/*.ts : Handle clipboard data in plugins by checking if query is a string (backward compatibility) or TuffQuery object with inputs array containing type-specific data
📚 Learning: 2025-11-29T07:46:02.249Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Execute type checking with `npm run typecheck` (main + renderer process) from apps/core-app/ directory

Applied to files:

  • .github/workflows/ci.yml
  • package.json
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Run `npm run typecheck` within apps/core-app/ for TypeScript validation. Use `npm run typecheck:node` for main process and `npm run typecheck:web` for renderer process validation.

Applied to files:

  • .github/workflows/ci.yml
  • package.json
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Use pnpm workspace commands for development. Core development uses `pnpm core:dev` for the development server, `pnpm core:build` for production builds, with platform-specific variants for Windows, macOS, and Linux.

Applied to files:

  • package.json
📚 Learning: 2025-11-29T07:46:02.249Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Use `pnpm core:dev` to start Electron application development server

Applied to files:

  • package.json
📚 Learning: 2025-11-29T07:46:02.249Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Monorepo structure uses pnpm workspace with apps/, packages/, plugins/, and apps/docs/ directories

Applied to files:

  • package.json
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Maintain the talex-touch/utils package as a shared npm package for external plugin developers. Ensure type definitions and utilities are exported for public use.

Applied to files:

  • package.json
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to apps/core-app/src/main/modules/box-tool/**/*.{ts,tsx} : Position CoreBox windows screen-aware using cursor position to select the appropriate display in multi-monitor setups.

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to **/plugins/**/*.{ts,tsx,js,jsx} : Use TuffInputType enum values (text, image, files, html) when handling clipboard data in plugins. Check query.inputs array to find specific input types and access their content and thumbnail properties.

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
📚 Learning: 2025-11-29T07:46:02.249Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Applies to plugins/**/*.ts : Handle clipboard data in plugins by checking if query is a string (backward compatibility) or TuffQuery object with inputs array containing type-specific data

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts
  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to apps/core-app/src/renderer/src/**/*.{ts,tsx,vue} : Use Pinia stores and composables in src/modules/hooks/ for state management in the renderer process instead of local component state.

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to **/plugins/**/*.{ts,tsx,js,jsx} : Handle backward compatibility in plugins by checking if query is a string (legacy text-only query) before treating it as a TuffQuery object with inputs array.

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to **/plugins/**/manifest.json : Declare acceptedInputTypes array in plugin manifest features to specify supported input types (text, image, files, html) from clipboard data.

Applied to files:

  • apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts
🧬 Code graph analysis (2)
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts (1)
apps/core-app/src/renderer/src/modules/box/adapter/index.ts (1)
  • BoxMode (1-1)
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts (1)
apps/core-app/src/renderer/src/modules/channel/channel-core.ts (1)
  • touchChannel (196-196)
🔇 Additional comments (8)
apps/core-app/src/renderer/src/modules/box/adapter/hooks/useKeyboard.ts (2)

27-30: Good documentation of the keyboard handler.

The JSDoc comment clearly describes the function's purpose.


110-144: Well-structured ESC key sequential handling.

The refactored ESC flow is clear and follows a logical priority order. The inline documentation accurately describes each step.

One minor observation: on line 121, handleExit() is called which (per useSearch.ts) will invoke deactivateAllProviders() and return early without hiding the window—matching the intended behavior of step 1.

apps/core-app/src/renderer/src/modules/box/adapter/hooks/useSearch.ts (3)

49-52: Debounce timing looks appropriate.

35ms base debounce with 100ms when providers are active provides responsive feedback while avoiding excessive queries.


220-225: Good defensive guard for missing item.

Adding the early return with warning when handleExecute is called without an item prevents potential null reference errors.


201-214: The original review comment is factually incorrect about the @vueuse/core API.

useDebounceFn from @vueuse/core does have a flush() method. According to official documentation, flush() immediately invokes any pending debounced call and clears the pending timer, returning the result of that immediate invocation. The code at lines 209-213 is correct, and the @ts-ignore comments are unnecessary but harmless—they can be removed since flush() is a legitimate, documented method on the debounce function returned by useDebounceFn.

Likely an incorrect or invalid review comment.

apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts (3)

12-33: Clean timestamp normalization helper.

The normalizeTimestamp function handles various input types defensively with proper Number.isFinite checks. Good edge case handling.


95-190: Comprehensive auto-fill logic with good duplicate prevention.

The handleAutoFill function properly:

  • Checks preconditions before processing
  • Uses timestamp-based deduplication
  • Handles files, short text, long text, and images distinctly
  • Cleans up expired records probabilistically to prevent memory growth

297-323: I'll verify the review comment about the channel listener cleanup issue. Let me start by examining the implementation of regChannel and how the useClipboard hook is used.
<function_calls>

#!/bin/bash

First, locate the useClipboard file and understand its structure

find . -name "useClipboard.ts" -type f


</function_calls>
<function_calls>

#!/bin/bash

Check the full useClipboard.ts file structure

wc -l "apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts"


</function_calls>
<function_calls>

#!/bin/bash

Read the useClipboard.ts file to understand context and cleanup patterns

cat -n "apps/core-app/src/renderer/src/modules/box/adapter/hooks/useClipboard.ts"


</function_calls>

TalexDreamSoul and others added 2 commits November 29, 2025 20:14
Removes the `core:` prefix from pnpm build scripts in the build-and-release workflow. This change aligns with recent script simplifications.

Additionally, applies code style formatting to the search-logger module.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts (1)

37-40: Migrate from raw console + chalk to the project's standard logger via createLogger()

The review comment correctly identifies a logging inconsistency, but the recommendation should be clarified. While the project documentation mentions log4js, the actual logging standard is implemented via the custom createLogger() function in apps/core-app/src/main/utils/logger.ts, which wraps console output (polyfilled to log4js) with structured namespaces, timestamps, and colored output.

Changes needed:

  • Replace raw console.log and console.error calls with createLogger('box-tool:search-engine')
  • Remove the chalk import and formatting chains; the logger handles coloring via namespace-based palette
  • Use logger methods: logger.info(), logger.warn(), logger.error(), logger.debug(), logger.success()
  • Support structured metadata via the optional LogOptions parameter (e.g., { meta: { key: value } })

This approach clears the no-console lint flags, provides consistent logging across the codebase, and leverages the project's established logging infrastructure rather than duplicating console + chalk patterns.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05c5156 and cefac54.

📒 Files selected for processing (2)
  • .github/workflows/build-and-release.yml (2 hunks)
  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts (10 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/core-app/src/main/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/core-app/src/main/**/*.{ts,tsx}: Register IPC channel handlers in the main process using regChannel(type, eventName, callback). Use ChannelType.MAIN for main-renderer communication and ChannelType.PLUGIN for plugin-specific channels.
Use sendPlugin(pluginName, eventName, arg) to send messages from main process to plugins, and use requestKey(name) to manage encrypted keys for plugin isolation.
Use TouchWindow wrapper for window creation instead of directly using Electron BrowserWindow. Enable platform-specific effects: Vibrancy on macOS and Mica on Windows.
Use two-phase window setup with TouchWindow: separate creation from rendering. Use autoShow option to control initial visibility.
Use DevProcessManager to prevent app quit events in development environment, allowing custom cleanup without forcing application exit.

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
apps/core-app/src/main/modules/box-tool/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Position CoreBox windows screen-aware using cursor position to select the appropriate display in multi-monitor setups.

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
apps/core-app/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/core-app/src/**/*.{ts,tsx}: Use log4js for logging with structured namespaces, timestamps, and colored output. Provide meaningful namespace identifiers for debugging.
Import and use shared types and utilities from @talex-touch/utils package. Use enums like TuffInputType, TalexEvents, and ChannelType from the shared package.

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
apps/core-app/src/main/modules/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

apps/core-app/src/main/modules/**/*.ts: In main process architecture, inherit from BaseModule with required onInit() and onDestroy() methods, and optional created(), start(), and stop() lifecycle methods
Module directory pattern: request isolated directory from ModuleManager for module-specific persistent storage without knowing root path

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
apps/core-app/src/main/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

apps/core-app/src/main/**/*.ts: Register IPC channels using regChannel(type: ChannelType, eventName: string, callback) and send messages via send(), sendTo(), or sendPlugin() methods
Use log4js for structured logging with namespaces, timestamps, and colored output for debugging
DevProcessManager prevents application quit events during development to allow custom cleanup logic

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
apps/core-app/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Import shared types and utilities from @talex-touch/utils package in plugins and application code

Files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-29T07:46:02.249Z
Learning: Execute type checking with `npm run typecheck` (main + renderer process) from apps/core-app/ directory
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Run `npm run typecheck` within apps/core-app/ for TypeScript validation. Use `npm run typecheck:node` for main process and `npm run typecheck:web` for renderer process validation.
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Use pnpm workspace commands for development. Core development uses `pnpm core:dev` for the development server, `pnpm core:build` for production builds, with platform-specific variants for Windows, macOS, and Linux.

Applied to files:

  • .github/workflows/build-and-release.yml
📚 Learning: 2025-11-29T07:45:45.435Z
Learnt from: CR
Repo: talex-touch/tuff PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T07:45:45.435Z
Learning: Applies to apps/core-app/src/**/*.{ts,tsx} : Use log4js for logging with structured namespaces, timestamps, and colored output. Provide meaningful namespace identifiers for debugging.

Applied to files:

  • apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts
🪛 ESLint
apps/core-app/src/main/modules/box-tool/search-engine/search-logger.ts

[error] 15-15: Expected a comma.

(style/member-delimiter-style)


[error] 15-15: Expected a comma.

(style/member-delimiter-style)


[error] 41-41: Closing curly brace appears on the same line as the subsequent block.

(style/brace-style)


[error] 46-46: Closing curly brace appears on the same line as the subsequent block.

(style/brace-style)


[error] 83-83: Closing curly brace appears on the same line as the subsequent block.

(style/brace-style)


[error] 83-83: 'error' is defined but never used.

(unused-imports/no-unused-vars)


[error] 83-83: 'error' is defined but never used.

(ts/no-unused-vars)


[error] 104-104: Closing curly brace appears on the same line as the subsequent block.

(style/brace-style)


[error] 108-108: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 109-109: Closing curly brace appears on the same line as the subsequent block.

(style/brace-style)


[error] 125-125: Expect newline after if

(antfu/if-newline)


[error] 131-131: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 132-132: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 133-133: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 134-134: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 145-145: Expect newline after if

(antfu/if-newline)


[error] 149-149: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 150-150: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 151-151: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 152-152: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 179-179: Expect newline after if

(antfu/if-newline)


[error] 185-185: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 186-186: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 187-187: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 187-187: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 188-188: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 197-197: Expect newline after if

(antfu/if-newline)


[error] 198-198: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 199-199: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 200-200: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 200-200: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 201-201: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 207-207: Expect newline after if

(antfu/if-newline)


[error] 208-208: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 209-209: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 210-210: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 210-210: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 211-211: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 221-221: Expect newline after if

(antfu/if-newline)


[error] 233-233: Expect newline after if

(antfu/if-newline)


[error] 235-235: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 236-236: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 237-237: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 237-237: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 238-238: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 248-248: Expect newline after if

(antfu/if-newline)


[error] 249-249: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 250-250: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 251-251: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 251-251: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 252-252: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 255-255: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 260-260: Expect newline after if

(antfu/if-newline)


[error] 261-261: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 262-262: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 263-263: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 263-263: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 264-264: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 270-270: Expect newline after if

(antfu/if-newline)


[error] 271-271: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 272-272: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 273-273: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 273-273: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 282-282: Expect newline after if

(antfu/if-newline)


[error] 283-283: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 284-284: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 285-285: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 285-285: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 286-286: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 292-292: Expect newline after if

(antfu/if-newline)


[error] 293-293: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 294-294: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 295-295: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 295-295: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 296-296: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 302-302: Expect newline after if

(antfu/if-newline)


[error] 303-303: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 304-304: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 305-305: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 305-305: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 306-306: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 307-307: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 313-313: Expect newline after if

(antfu/if-newline)


[error] 314-314: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 315-315: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 316-316: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 316-316: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 322-322: Expect newline after if

(antfu/if-newline)


[error] 323-323: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 324-324: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 325-325: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 325-325: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 326-326: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 327-327: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 333-333: Expect newline after if

(antfu/if-newline)


[error] 334-334: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 335-335: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 336-336: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 336-336: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 337-337: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 338-338: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 344-344: Expect newline after if

(antfu/if-newline)


[error] 345-345: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 346-346: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 347-347: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 347-347: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 348-348: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 349-349: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 355-355: Expect newline after if

(antfu/if-newline)


[error] 356-356: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 357-357: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 358-358: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 358-358: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 359-359: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 365-365: Expect newline after if

(antfu/if-newline)


[error] 366-366: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 367-367: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 368-368: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 368-368: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 374-374: Expect newline after if

(antfu/if-newline)


[error] 375-375: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 376-376: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 377-377: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 377-377: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 383-383: Expect newline after if

(antfu/if-newline)


[error] 384-384: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 385-385: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 386-386: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 394-394: Expect newline after if

(antfu/if-newline)


[error] 395-395: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 396-396: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 397-397: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 397-397: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 403-403: Expect newline after if

(antfu/if-newline)


[error] 404-404: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 405-405: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 406-406: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 411-411: Expect newline after if

(antfu/if-newline)


[error] 412-412: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 413-413: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 414-414: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 414-414: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 415-415: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 421-421: Expect newline after if

(antfu/if-newline)


[error] 422-422: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 423-423: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 424-424: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 424-424: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 430-430: Expect newline after if

(antfu/if-newline)


[error] 431-431: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 432-432: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 433-433: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 433-433: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 434-434: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 440-440: Expect newline after if

(antfu/if-newline)


[error] 441-441: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 442-442: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 443-443: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 443-443: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 449-449: Expect newline after if

(antfu/if-newline)


[error] 450-450: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 451-451: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 452-452: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 452-452: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 458-458: Expect newline after if

(antfu/if-newline)


[error] 459-459: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 460-460: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 461-461: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 461-461: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 462-462: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 468-468: Expect newline after if

(antfu/if-newline)


[error] 469-469: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 470-470: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 471-471: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 471-471: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 477-477: Expect newline after if

(antfu/if-newline)


[error] 478-478: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 479-479: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 480-480: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 480-480: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 481-481: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 490-490: Expect newline after if

(antfu/if-newline)


[error] 491-491: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 492-492: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 493-493: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 493-493: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 494-494: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 500-500: Expect newline after if

(antfu/if-newline)


[error] 501-501: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 507-507: Expect newline after if

(antfu/if-newline)


[error] 508-508: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 512-512: Expect newline after if

(antfu/if-newline)


[error] 513-513: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 514-514: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 515-515: Expected indentation of 6 spaces

(style/indent-binary-ops)


[error] 515-515: '+' should be placed at the beginning of the line.

(style/operator-linebreak)


[error] 516-516: '+' should be placed at the beginning of the line.

(style/operator-linebreak)

🔇 Additional comments (1)
.github/workflows/build-and-release.yml (1)

298-299: All npm script updates have been properly implemented and are consistent across the codebase.

The verification confirms:

  • ✓ All six new build:* scripts are defined in package.json
  • ✓ Scripts correctly delegate to the @talex-touch/core-app workspace
  • ✓ No remaining references to old core:build:* commands in workflow files
  • ✓ Old scripts have been removed from package.json

The workflow changes are ready and fully aligned with package.json definitions.

TalexDreamSoul and others added 3 commits November 29, 2025 20:45
…ogger.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: TalexDreamSoul <59305952+TalexDreamSoul@users.noreply.github.com>
…ogger.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: TalexDreamSoul <59305952+TalexDreamSoul@users.noreply.github.com>
…ogger.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: TalexDreamSoul <59305952+TalexDreamSoul@users.noreply.github.com>
@TalexDreamSoul TalexDreamSoul merged commit 3e6244c into master Nov 29, 2025
2 of 3 checks passed
@TalexDreamSoul TalexDreamSoul deleted the fix/2.4.7-251129 branch November 29, 2025 12:47
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.

1 participant