You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add EditorLauncher scaffold with centralized editor routing
Implement hybrid approach for editor activity routing that will support
both legacy EditPostActivity and future EditPostGutenbergKitActivity.
Changes:
- Add EditorLauncher singleton with feature-flag-based routing logic
- Migrate all ActivityLauncher methods to use EditorLauncher helper
- Add EditorLauncher to dependency injection (AppComponent)
- Include analytics tracking and source identification for launches
- Route to EditPostActivity for now (scaffold implementation)
This provides infrastructure for clean editor activity separation while
maintaining backward compatibility. Future changes will:
- Add EditorLauncherParams data class with builder pattern
- Route to EditPostGutenbergKitActivity when implemented
- Add redirection fallback with monitoring
Covers ActivityLauncher methods:
- openEditorForSiteInNewStack()
- openEditorForPostInNewStack()
- openEditorForReblog()
- addNewPostForResult() variants
- editPostOrPageForResult() variants
- editPageForResult() variants
- addNewPageForResult() variants
* Add EditorLauncherParams for type-safe editor launch parameters
Replace Bundle-based Intent extras with type-safe parameter objects
to improve maintainability and reduce errors.
Changes:
- Add EditorLauncherParams.kt with Kotlin data class and Java Builder pattern
- Update EditorLauncher.kt to accept EditorLauncherParams instead of Intent bundles
- Refactor ActivityLauncher.java methods to use EditorLauncherParams.Builder
- Add backward compatibility with deprecated Intent-based method
- Centralize all Intent extra handling in EditorLauncher.addEditorExtras()
- Maintain analytics tracking with type-safe parameter source detection
This provides compile-time safety while maintaining Java interoperability
through the builder pattern.
* Remove deprecated Intent-based EditorLauncher method
Complete migration to EditorLauncherParams for all ActivityLauncher methods.
Changes:
- Remove deprecated createEditorIntent(context, Intent) method from EditorLauncher
- Remove unused getIntentSource() legacy method
- Update remaining ActivityLauncher methods to use EditorLauncherParams.Builder:
- addNewPostWithContentFromAIForResult()
- addNewPageForResult() (both Activity and Fragment variants)
- All editor launches now use type-safe parameters instead of Bundle operations
This completes the EditorLauncherParams migration for ActivityLauncher,
providing compile-time safety and better maintainability.
* Fix Detekt code quality violations in EditorLauncher
Address all code quality issues identified by Detekt static analysis.
Changes:
- Remove unused imports (Bundle) and unused property (analyticsTracker)
- Replace TODO comments with regular comments to avoid ForbiddenComment violations
- Break down complex addEditorExtras() method into smaller helper methods:
- addBasicExtras() - site, page, promo flags
- addPostExtras() - post IDs, autosave, quickpress, landing editor flags
- addReblogExtras() - reblog title, quote, image, citation, action
- addPageExtras() - page title, content, template
- addMiscExtras() - voice content, media, prompt ID, entry point
- Fix MaxLineLength violations by splitting long builder method calls
- Add missing newline at end of EditorLauncherParams.kt
This reduces cyclomatic complexity and improves code maintainability
while maintaining all existing functionality.
* Move analytics source field handling into EditorLauncher
Centralizes the EXTRA_CREATION_SOURCE_DETAIL Intent extra creation in
EditorLauncher.addMiscExtras instead of requiring manual addition in
each ActivityLauncher method. This eliminates code duplication and
ensures analytics tracking is consistently applied across all editor launches.
Changes:
- Add AnalyticsUtils.EXTRA_CREATION_SOURCE_DETAIL to EditorLauncher.addMiscExtras
- Remove redundant analytics field additions from ActivityLauncher methods
- Add AnalyticsUtils import to EditorLauncher
* Require non-null SiteModel in EditorLauncherParams.Builder constructor
Makes the Java Builder pattern more type-safe by requiring SiteModel in the constructor
rather than checking for null at build time.
Changes:
- EditorLauncherParams.Builder now takes @nonnull SiteModel in constructor
- Remove site() setter method from Builder
- Remove runtime requireNotNull check in build()
- Update all call sites to pass site to constructor
- Add missing @nonnull annotations in ActivityLauncher
* Add analytics tracking to EditorLauncher
Tracks editor launches with should_use_gutenberg_kit property to understand
feature flag usage patterns.
* Add documentation and test for EditorLauncherParams field mapping
Ensures all EditorLauncherParams fields are handled in EditorLauncher.addEditorExtras()
through documentation and a unit test that validates completeness.
Changes:
- Add cross-reference documentation in EditorLauncherParams and EditorLauncher
- Add EditorLauncherTest with detailed field-to-method mapping documentation
- Test validates that all fields are accounted for in addEditorExtras methods
- Filter out Kotlin synthetic fields in test validation
* Fix line length in EditorLauncherTest
* Update analytics property name to will_use_gutenberg_kit
* Add tracking for EditorLauncher vs direct Intent launches
Adds a way to distinguish editor launches that went through EditorLauncher
vs direct Intent creation for analytics purposes.
Changes:
- EditorLauncher: Add EXTRA_LAUNCHED_VIA_EDITOR_LAUNCHER intent extra
- EditPostActivity: Track EDITOR_LAUNCHED_VIA_EDITOR_LAUNCHER when extra is present (only on initial creation, not configuration changes)
- AnalyticsTracker: Add EDITOR_LAUNCHED_VIA_EDITOR_LAUNCHER stat
* Fix line length in EditPostActivity
* Add null checks for PostModel in editPostOrPageForResult methods
Prevents crashes when PostModel is null (e.g., when mPostStore.getPostByLocalPostId
returns null for non-existent posts) by showing a user-friendly error message instead.
Changes:
- Add null check and error toast in both editPostOrPageForResult variants
- Prevents crashes from calling post.getId() or post.isPage() on null objects
* Make all boolean parameters nullable to avoid unintended defaults
The trunk editPostOrPageForResult methods never set boolean extras like
EXTRA_IS_PAGE, EXTRA_IS_PROMO, or EXTRA_LOAD_AUTO_SAVE_REVISION unless
explicitly required. Making all boolean parameters nullable ensures they're
only set when explicitly provided, matching trunk behavior exactly.
Changes:
- Make all boolean fields nullable in EditorLauncherParams and Builder
- Update EditorLauncher to only set extras when parameters are non-null
- Remove unnecessary loadAutoSaveRevision(false) from first editPostOrPageForResult
- Preserves explicit boolean settings in other methods (pages, promos, etc.)
* Don't set source in ActivityLauncher.openEditorForReblog
0 commit comments