Browse Source

migrate: PhotoDialog.vue to use () API

- Replace settings.activeDid with () pattern
- Maintains backward compatibility with existing functionality
- Component now uses active_identity table as single source of truth
- Part of ActiveDid migration (2/32 components completed)
- Updated migration plan to include lint-fix step
pull/188/head
Matthew Raymer 2 weeks ago
parent
commit
4cb1d8848f
  1. 22
      doc/activeDid-migration-plan.md
  2. 6
      src/components/PhotoDialog.vue

22
doc/activeDid-migration-plan.md

@ -445,12 +445,32 @@ async function rollbackActiveDidMigration(): Promise<boolean> {
| **Start application in browser** | Application loads and initializes IndexedDB database | ✅ COMPLETE | | **Start application in browser** | Application loads and initializes IndexedDB database | ✅ COMPLETE |
| **Inspect IndexedDB via DevTools** | Verify active_identity table exists and contains data | ✅ COMPLETE | | **Inspect IndexedDB via DevTools** | Verify active_identity table exists and contains data | ✅ COMPLETE |
| **Update first component** | One component successfully uses new API pattern | ✅ COMPLETE (HomeView.vue) | | **Update first component** | One component successfully uses new API pattern | ✅ COMPLETE (HomeView.vue) |
| **Systematic component updates** | All 32 remaining components use new API pattern | 🟢 HIGH | | **Systematic component updates** | All 32 remaining components use new API pattern (with test:web after each) | 🟢 HIGH |
| **Test all platforms** | Web, Electron, iOS, Android platforms verified working | 🟡 MEDIUM | | **Test all platforms** | Web, Electron, iOS, Android platforms verified working | 🟡 MEDIUM |
| **Performance optimization** | Reduce excessive $getActiveIdentity() calls | 🟡 MEDIUM | | **Performance optimization** | Reduce excessive $getActiveIdentity() calls | 🟡 MEDIUM |
**Critical Blocker**: API layer complete. Ready to proceed with component updates. **Critical Blocker**: API layer complete. Ready to proceed with component updates.
## Migration Execution Rule
### **One Component + Test Pattern**
**Rule**: After migrating each component, run `npm run test:web` and `npm run lint-fix` to verify the change doesn't break existing functionality and meets code standards.
**Workflow**:
1. **Migrate one component** - Update to use `$getActiveIdentity()` pattern
2. **Run lint-fix** - Ensure code meets project standards
3. **Run test:web** - Verify no regressions introduced
4. **Commit if passing** - Only commit after tests and linting pass
5. **Repeat** - Move to next component
**Benefits**:
- Catch issues immediately after each change
- Maintain code quality throughout migration
- Easy rollback if problems arise
- Systematic progress tracking
**Exit Criteria**: All 32 components migrated with passing tests
## Performance Observations ## Performance Observations
### Excessive API Calls Detected ### Excessive API Calls Detected

6
src/components/PhotoDialog.vue

@ -268,7 +268,11 @@ export default class PhotoDialog extends Vue {
// logger.log("PhotoDialog mounted"); // logger.log("PhotoDialog mounted");
try { try {
const settings = await this.$accountSettings(); const settings = await this.$accountSettings();
this.activeDid = settings.activeDid || "";
// Get activeDid from active_identity table (single source of truth)
const activeIdentity = await this.$getActiveIdentity();
this.activeDid = activeIdentity.activeDid || "";
this.isRegistered = !!settings.isRegistered; this.isRegistered = !!settings.isRegistered;
logger.log("isRegistered:", this.isRegistered); logger.log("isRegistered:", this.isRegistered);
} catch (error: unknown) { } catch (error: unknown) {

Loading…
Cancel
Save