Skip to content

Conversation

@Bhogeshwarj
Copy link

@Bhogeshwarj Bhogeshwarj commented Nov 22, 2025

Closes issue: requestly/requestly#3746

🎥 Demo Video:

Video/Demo:
Before :
Screenshot 2025-11-22 at 7 03 44 PM

After :

Screen.Recording.2025-11-22.at.7.02.49.PM.mov

📜 Summary of changes:

📝 Overview

Implemented a new feature that allows users to exclude errored files directly from
the UI. When a workspace contains invalid/unsupported files, users can now click an
"Exclude" button to permanently ignore these files in future workspace scans.


✨ What's New

User-Facing Features

  • ✅ Added "Exclude" button (eye-off icon) next to each errored file in the sidebar
  • ✅ One-click exclusion of problematic files from workspace scanning
  • ✅ Excluded files are stored in requestly.json and persist across app restarts
  • ✅ Automatic workspace refresh after exclusion
  • ✅ Success/error toast notifications for user feedback

🏗️ Architecture

The implementation follows the existing architecture pattern and leverages the
already-present exclusion mechanism:

UI (React) → Repository → Adapter → IPC → Desktop App (FsManager) → requestly.json

How It Works

  1. User clicks "Exclude" on an errored file
  2. File path is added to the exclude array in workspace's requestly.json
  3. FsIgnoreManager is reloaded with updated exclusion patterns
  4. Workspace automatically refreshes
  5. Excluded file no longer appears in error files list

📁 Files Changed

Desktop App (requestly-desktop-app)

  1. Core Logic
  • src/renderer/actions/local-sync/fs-manager.ts
    • Added excludeFile(filePath) method (lines 128-210)
    • Validates file is within workspace root
    • Converts absolute path to relative path
    • Adds to requestly.json exclude array (avoids duplicates)
    • Automatically reloads FsIgnoreManager
  1. IPC Service
  • src/renderer/actions/local-sync/fs-manager.rpc-service.ts
    • Exposed excludeFile method via RPC (lines 154-157)
    • IPC channel: local_sync: ${workspacePath}-excludeFile

Webapp (requestly/app)

  1. Adapter Layer
  • src/services/fsManagerServiceAdapter.ts
    • Added excludeFile(filePath) method (lines 179-182)
    • Decorated with @FsErrorHandler for error handling
  1. Repository Interface
  • src/features/apiClient/helpers/modules/sync/interfaces.ts
    • Added excludeErrorFile(filePath) to ApiClientRecordsInterface (line 87)
  1. Repository Implementation
  • src/features/apiClient/helpers/modules/sync/local/services/LocalApiClientRecordsS
    ync.ts
    • Implemented excludeErrorFile() method (lines 595-614)
    • Calls adapter's excludeFile() method
  1. UI Component
  • src/features/apiClient/screens/apiClient/components/sidebar/components/ErrorFiles
    List/ErrorFileslist.tsx
    • Imported MdVisibilityOff icon (line 5)
    • Added excludeErrorFile prop to ErrorFileItem (line 109)
    • Added exclude button with tooltip (lines 119-121)
    • Implemented handleExcludeErrorFile handler (lines 185-205)
    • Triggers forceRefreshRecords/Environments after exclusion

Exclusion Mechanism

  • Uses existing FsIgnoreManager class
  • Leverages ignore npm package (gitignore-style patterns)
  • Supports:
    • Exact file matches: "file.txt"
    • Wildcards: ".log", "**/.tmp"
    • Folder patterns: "node_modules", "dist/**"

Filtering Flow

  1. getAllRecords() → parseFolder()
  2. parseFolder() → sanitizeFsResourceList(..., this.fsIgnoreManager)
  3. sanitizeFsResourceList() → fsIgnoreManager.checkShouldIgnore(path)
  4. Excluded files are filtered out before parsing
  5. Only non-excluded files can appear in erroredRecords

✅ Testing Checklist

  • Desktop app compiles without errors
  • Webapp compiles without errors
  • Exclude button appears for each errored file
  • Clicking exclude adds correct path to requestly.json
  • No first character missing in saved paths
  • No trailing slashes in saved paths
  • Excluded file disappears after workspace refresh
  • Success toast notification appears
  • Error handling works for invalid paths
  • Works for both API and Environment error files
  • Exclusions persist across app restarts
  • Duplicate exclusions are prevented

🎨 UI Changes

Before: Errored files only had "Edit" and "Delete" buttons

After: Errored files now have "Edit", "Exclude" (eye-off icon), and "Delete"
buttons


📊 Impact

  • User Experience: Users can now manage problematic files without manually editing
    requestly.json
  • Backwards Compatible: No breaking changes, works with existing workspaces
  • Performance: No performance impact, uses existing exclusion infrastructure
  • Maintainability: Follows existing code patterns and architecture

🔗 Related

  • Builds on existing FsIgnoreManager infrastructure
  • No new dependencies added
  • No schema changes (uses existing requestly.json structure)

Summary by CodeRabbit

  • New Features
    • Added file exclusion capability to exclude specific files from workspace synchronization, with changes automatically persisted to configuration and applied immediately upon workspace reload.

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 22, 2025

Walkthrough

This change introduces a new file exclusion capability to the local sync manager. A new excludeFile method is added to the FsManager class that validates file paths, converts them to workspace-relative paths, appends them to the exclude list in the configuration file (requestly.json), and reloads the workspace to apply changes. This method is also exposed over IPC through FsManagerRPCService to make it callable from other application components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • FsManager.excludeFile method: Requires verification of path validation logic, workspace-relative path normalization, config loading/updating flow, and workspace reload mechanism
  • Error handling: Confirm that all error cases (invalid path, missing config, file write failures) are properly caught and returned as FileSystemResult
  • Config file integrity: Ensure the exclude list updates preserve existing configuration and handle edge cases (duplicate entries, path normalization consistency)

Possibly related issues

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat:exclude error files(3746)' is directly related to the changeset. It accurately describes the main feature being added: an exclusion mechanism for error files, which is the core purpose of the PR as confirmed by the objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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: 0

🧹 Nitpick comments (1)
src/renderer/actions/local-sync/fs-manager.ts (1)

128-157: Consider simplifying the path normalization logic.

The current implementation uses getNormalizedPath (line 131) which adds a trailing slash designed for directories, then removes it later (lines 155-157). This add-then-remove pattern works but is unnecessarily complex.

Consider this simpler approach:

-    const normalizedFilePath = getNormalizedPath(filePath);
+    // Ensure absolute path
+    const absolutePath = filePath;
 
     // Validate that file is within workspace
-    if (!normalizedFilePath.startsWith(this.rootPath)) {
+    if (!absolutePath.startsWith(this.rootPath.replace(/\/$/, ''))) {
       return {
         type: "error",
         error: {
           code: ErrorCode.WrongInput,
           message: "File path must be within the workspace root",
           path: filePath,
           fileType: FileTypeEnum.UNKNOWN,
         },
       };
     }
 
     // Convert absolute path to relative path
-    let relativePath = normalizedFilePath.replace(this.rootPath, "");
-
-    // Remove leading slash if present
-    if (relativePath.startsWith("/")) {
-      relativePath = relativePath.substring(1);
-    }
-
-    // Remove trailing slash if present (files shouldn't have trailing slashes)
-    if (relativePath.endsWith("/")) {
-      relativePath = relativePath.substring(0, relativePath.length - 1);
-    }
+    let relativePath = absolutePath
+      .replace(this.rootPath, "")
+      .replace(/^\/+/, "")  // Remove leading slashes
+      .replace(/\/+$/, ""); // Remove trailing slashes

Alternatively, keep the current implementation if directory exclusions with trailing slashes are intentionally supported.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd716fa and ddef558.

📒 Files selected for processing (2)
  • src/renderer/actions/local-sync/fs-manager.rpc-service.ts (1 hunks)
  • src/renderer/actions/local-sync/fs-manager.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/renderer/actions/local-sync/fs-manager.ts (5)
src/renderer/actions/local-sync/types.ts (1)
  • FileSystemResult (45-45)
src/renderer/actions/local-sync/common-utils.ts (2)
  • getNormalizedPath (22-25)
  • appendPath (27-30)
src/renderer/actions/local-sync/schemas.ts (1)
  • Config (5-8)
src/renderer/actions/local-sync/constants.ts (1)
  • CONFIG_FILE (5-5)
src/renderer/actions/local-sync/fs-utils.ts (1)
  • writeContentRaw (314-350)
🔇 Additional comments (4)
src/renderer/actions/local-sync/fs-manager.rpc-service.ts (1)

154-157: LGTM! Method exposure follows established patterns.

The IPC exposure of excludeFile is correctly implemented and consistent with other method exposures in this service.

src/renderer/actions/local-sync/fs-manager.ts (3)

160-179: Good defensive programming and idempotency handling.

The config validation and duplicate checking ensure the method is safe and idempotent, returning early if the path is already excluded.


182-207: LGTM! Config update and reload logic is correct.

The implementation properly updates the config, writes it atomically, and reloads the workspace to apply exclusion changes immediately.


208-219: Error handling follows established patterns.

The catch-all error handler appropriately uses ErrorCode.UNKNOWN and returns a properly structured FileSystemError.

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