Skip to content

🔥 Remove project linking system#207

Merged
Robdel12 merged 2 commits intomainfrom
remove-project-linking
Feb 9, 2026
Merged

🔥 Remove project linking system#207
Robdel12 merged 2 commits intomainfrom
remove-project-linking

Conversation

@Robdel12
Copy link
Contributor

@Robdel12 Robdel12 commented Feb 9, 2026

Summary

Simplifies the auth model to two clear paths: vizzly login (interactive) and VIZZLY_TOKEN (CI). The per-directory project mapping system (project:select) was built before user JWTs worked on all API endpoints — now it's unnecessary overhead.

What's removed:

  • project:select, project:list, project:token, project:remove CLI commands
  • Project mapping storage in ~/.vizzly/config.json (stale keys harmlessly ignored, no migration needed)
  • Project mapping lookup from config loader token resolution chain
  • Mapping endpoints from projects router (/api/projects/mappings, /api/builds/recent)
  • Mapping operations/helpers from project/operations.js and project/core.js
  • Projects tab from reporter dashboard (was only for mapping management)
  • Mapping hooks and API client methods from reporter

What's added/changed:

  • --project <slug> filter on comparisons command (matches existing builds pattern)
  • DeviceFlowLogin moved inline into Builds view (was only reusable piece from deleted Projects tab)
  • Context display updated to reference vizzly login instead of project:select

What stays unchanged:

  • vizzly login / logout / whoami
  • vizzly projects / vizzly orgs commands
  • VIZZLY_TOKEN env var + --token flag
  • Builds tab in dashboard (project browsing + baseline downloads)
  • All auth endpoints and hooks

-2,763 lines deleted, 215 added across 27 files.

Test plan

  • npm test — 1862 tests pass, 0 failures
  • npm run lint — clean
  • npm run build — compiles (151 files + reporter bundle)
  • vizzly --help — no project:* commands in output
  • vizzly tdd start — dashboard loads, Builds tab works, no Projects tab
  • vizzly builds --project <slug> — filters by project
  • vizzly comparisons --project <slug> — filters by project

Simplify auth model to two clear paths: `vizzly login` (interactive)
and `VIZZLY_TOKEN` (CI). The per-directory project mapping system
(`project:select`) is no longer needed now that user JWTs work on all
API endpoints.

- Remove `project:select`, `project:list`, `project:token`,
  `project:remove` commands and CLI registrations
- Remove project mapping storage from global config
- Remove project mapping lookup from config loader token resolution
- Remove mapping endpoints from projects router and project service
- Remove mapping operations and helpers from project/operations and
  project/core
- Delete Projects tab from reporter dashboard, move DeviceFlowLogin
  into Builds view inline
- Remove mapping hooks and API client methods from reporter
- Add `--project <slug>` filter to `comparisons` command
- Clean up context display to remove mapping references
- Delete test files for removed code, update remaining tests
@vizzly-testing

This comment has been minimized.

@claude
Copy link

claude bot commented Feb 9, 2026

PR Review: Remove Project Linking System

Overview

This is a well-executed refactoring that significantly simplifies the authentication model. The removal of 2,763 lines while adding only 215 demonstrates effective code deletion. All tests pass (1862/1862) and the changes maintain architectural consistency.

Recommendation: ✅ Approve with requested changes


Issues Found

🟡 Medium: --project filter not working for comparisons search

Location: src/api/endpoints.js:240

The searchComparisons function doesn't extract the project filter:

// Current code (line 240)
let { branch, limit = 50, offset = 0 } = filters;
let params = { name, limit: String(limit), offset: String(offset) };
if (branch) params.branch = branch;

But src/commands/comparisons.js:88 passes it in filters:

if (options.project) filters.project = options.project;

Impact: The --project flag on comparisons command will be silently ignored when searching by name.

Fix: Add project to the destructured filters:

let { branch, project, limit = 50, offset = 0 } = filters;
let params = { name, limit: String(limit), offset: String(offset) };
if (branch) params.branch = branch;
if (project) params.project = project;

Note: The getBuilds function correctly uses buildQueryParams() which handles all filters generically. Consider refactoring searchComparisons to use the same approach for consistency.


🟡 Minor: Stale JSDoc comment

Location: src/project/operations.js:5

The JSDoc still references mappingStore:

* - mappingStore: for reading/writing project mappings

This parameter no longer exists after removing mapping functionality. Update or remove this comment.


🟡 Minor: Unused isUserAuth flag

Location: src/utils/config-loader.js:109

The config loader sets config.isUserAuth = true to distinguish user tokens from project tokens, but this flag isn't used anywhere in the codebase. If not needed for future use, consider removing it.


Positive Observations

Clean architecture - Maintains dependency injection and service-oriented patterns
Safe migration - Old config keys are harmlessly ignored, no breaking changes to config format
Good test coverage - Both unit tests added for --project filter, though E2E coverage would catch the API integration issue
Security improvement - Reduces authentication surface area and removes complex state management
Graceful degradation - Empty project lists handled correctly in dashboard
Component reuse - DeviceFlowLogin correctly moved inline to Builds view (only remaining usage)


Suggestions for Future Consideration

  1. User experience: When users run deprecated commands like vizzly project:select, they get "unknown command". Consider adding a helpful error pointing to the new workflow (vizzly login).

  2. Documentation: Update docs/guides to reflect the new auth model and migration path from project linking.

  3. E2E testing: Add integration tests that verify --project filter works end-to-end with the API to catch issues like the one found in searchComparisons.


Summary

This PR successfully achieves its goal of simplifying authentication to two clear paths. The identified issues are minor and easily fixable. Once the searchComparisons filter bug is addressed, this is ready to merge.

Test Status: ✅ 1862/1862 passing
Lint: ✅ Clean
Build: ✅ Compiles successfully

- Extract `project` from filters in `searchComparisons` so the flag
  actually gets passed to the API
- Remove stale JSDoc referencing mappingStore in operations.js
- Remove unused `isUserAuth` flag from config loader
@Robdel12 Robdel12 enabled auto-merge (squash) February 9, 2026 01:55
@vizzly-testing
Copy link

vizzly-testing bot commented Feb 9, 2026

Vizzly - Visual Test Results

CLI Reporter - 11 changes need review
Status Count
Passed 8
Changed 11
Auto-approved 8
Changes needing review (11)

filter-failed-only · Firefox · 1920×1080 · 11.3% diff

filter-failed-only

search-no-results · Firefox · 1920×1080 · 11.3% diff

search-no-results

dashboard-mixed-state · Firefox · 1920×1080 · 11.3% diff

dashboard-mixed-state

fullscreen-viewer · Firefox · 1920×1080 · 5.4% diff

fullscreen-viewer

bulk-accept-dialog · Firefox · 1920×1080 · 11.3% diff

bulk-accept-dialog

search-homepage · Firefox · 1920×1080 · 11.3% diff

search-homepage

...and 5 more in Vizzly.

Review changes

CLI TUI - 1 change needs review
Status Count
Passed 4
Changed 1
Auto-approved 4
Changes needing review (1)

vizzly-help · 1202×1430 · 298.5% diff

vizzly-help

Review changes


remove-project-linking · a7903679

@Robdel12 Robdel12 merged commit 0d18460 into main Feb 9, 2026
25 of 27 checks passed
@Robdel12 Robdel12 deleted the remove-project-linking branch February 9, 2026 01:56
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