Skip to content

Conversation

@Razano26
Copy link
Member

@Razano26 Razano26 commented Jun 12, 2025

Summary

  • add folders, tags, and password entry types
  • create hooks to fetch folders, tags, and credentials from the API
  • use the hooks in the password manager and related components
  • update components to reference new types

Testing

  • npm run lint (fails: prompts interactive setup)

https://chatgpt.com/codex/tasks/task_e_684b35fd0b988324b28fe96dd9c81aa9


Note

Replaces mock data with API-driven hooks for credentials, folders, and tags, and updates password manager/components to use new typed models.

  • Data layer:
    • New types: types/folder, types/password-entry, types/tag.
    • New hooks: use-credentials(userId) (maps API payload, computes strength), use-folders(userId), use-tags() fetching from ${NEXT_PUBLIC_API_URL}.
  • Password Manager (components/password-manager.tsx):
    • Removes inline mocks; loads data via new hooks with loading state; syncs into local state via useEffect.
    • Preserves filtering, folder path, add password/folder, and tag selection.
  • Components updated to new types:
    • components/folder-tree.tsx: props/types switched to Folder.
    • components/password-form.tsx: uses Folder and allTags; folder path helper adjusted.
    • components/password-list.tsx: uses Folder and PasswordEntry; integrates getPasswordUsage/usePassword for view/copy actions.

Written by Cursor Bugbot for commit 91183d4. This will update automatically on new commits. Configure here.

@Razano26
Copy link
Member Author

Razano26 commented Nov 4, 2025

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

lastUpdated: c.updated_at ?? c.created_at,
folderId: '',
tags: [],
}))
Copy link

Choose a reason for hiding this comment

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

Bug: Hardcoded defaults break filtering and types in credentials

The useCredentials hook hardcodes folderId to an empty string and tags to an empty array when mapping API responses. This breaks folder and tag filtering, as credentials won't match expected criteria. Additionally, potentially null API fields (e.g., title, domain_name) are directly assigned to required string types in PasswordEntry, risking runtime errors.

Fix in Cursor Fix in Web

const mapped = data.folders.map((f: any) => ({
id: f.Id,
name: f.Name,
parentId: f.ParentID,
Copy link

Choose a reason for hiding this comment

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

Bug: Robustness gaps in Folder parent handling rails.

The useFolders hook assumes the API response contains a folders property and that f.ParentID is never undefined. If the API returns a different structure or undefined for ParentID, this can lead to runtime errors or type mismatches with the Folder type's parentId: string | null expectation.

Fix in Cursor Fix in Web

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants