fix: Updating the check for matching app libraries path (#41139)

## Description

Updating the check for matching app libraries path to fix the
redirection to JS Libraries section when page has a custom path.

Fixes [#41138](https://github.com/appsmithorg/appsmith/issues/41138)

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/16566848024>
> Commit: 55233a42b73de66a5def0e1287ca2513d632e60a
> Workflow: `PR Automation test suite`
> Tags: `@tag.Sanity`
> Spec: ``
> <hr>Mon, 28 Jul 2025 10:40:58 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved path recognition for application libraries and packages,
supporting both standard and custom builder paths.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ankita Kinger 2025-07-28 16:57:34 +05:30 committed by GitHub
parent 2934bc6aa4
commit 9930224212
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,10 +124,12 @@ export const matchViewerForkPath = (pathName: string) =>
match(`${VIEWER_PATH_DEPRECATED}${VIEWER_FORK_PATH}`)(pathName);
export const matchAppLibrariesPath = (pathName: string) =>
match(`${BUILDER_PATH}${APP_LIBRARIES_EDITOR_PATH}`)(pathName);
match(`${BUILDER_PATH}${APP_LIBRARIES_EDITOR_PATH}`)(pathName) ||
match(`${BUILDER_CUSTOM_PATH}${APP_LIBRARIES_EDITOR_PATH}`)(pathName);
export const matchAppPackagesPath = (pathName: string) =>
match(`${BUILDER_PATH}${APP_PACKAGES_EDITOR_PATH}`)(pathName);
match(`${BUILDER_PATH}${APP_PACKAGES_EDITOR_PATH}`)(pathName) ||
match(`${BUILDER_CUSTOM_PATH}${APP_PACKAGES_EDITOR_PATH}`)(pathName);
export const addBranchParam = (branch: string) => {
const url = new URL(window.location.href);