Skip to content

Conversation

@maxy-shpfy
Copy link
Collaborator

@maxy-shpfy maxy-shpfy commented Jan 16, 2026

Description

Added a new TopNavActionsProvider system that allows components to register actions in the top navigation bar. This enables context-specific actions to appear in the global navigation.

Implemented a "Clone Pipeline" button in the top navigation bar for the Pipeline Run page, making this functionality more discoverable while maintaining the existing inline button.

Alternatives

Option A: React Portal

Use createPortal to render content into a designated DOM node in the menu.

Pros:

  • Built-in React API
  • Simple for single-target scenarios

Cons:

  • Only supports a single target DOM node — cannot render to both desktop and mobile locations simultaneously
  • Using two portals would require duplicate state management and event handlers
  • Mobile Sheet content only exists in DOM when open, causing document.getElementById() to return null
  • Not designed for "render same content in multiple places" use case

Verdict: ❌ Not suitable for this requirement

Option B: Module-Level Store (useSyncExternalStore)

Lightweight pub/sub pattern without React Context.

Pros:

  • No Provider required
  • Works from anywhere in the app
  • Minimal boilerplate

Cons:

  • Global mutable state
  • Less idiomatic React
  • Manual subscription management
  • High risk of state desync due to implementation complexity

Option C: Route-Based Conditional Rendering

Check current route in AppMenu and render appropriate actions.

Pros:

  • Explicit and simple
  • No additional abstractions

Cons:

  • AppMenu must know about all routes and their actions
  • Tight coupling, harder to maintain as app grows
  • Would require to place Providers on a higher level increasing complexity.

Verdict: ❌ Not suitable for this requirement

Option D: Render Component Twice (Simplest)

Render the same component in both locations; use CSS to control visibility.

Pros:

  • Simplest implementation, no additional abstractions
  • Easy to understand and debug

Cons:

  • Component exists twice in React tree (minor overhead)
  • Requires optional context hooks to handle cases where context isn't available
  • Slightly more coupling between AppMenu and page-specific actions
  • Would require to place Providers on a higher level increasing complexity.

Verdict: ❌ Not suitable for this requirement


Type of Change

  • New feature
  • Improvement

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

Screen Recording 2026-01-16 at 12.51.19 PM.mov (uploaded via Graphite)

  1. Navigate to a Pipeline Run page
  2. Verify the "Clone Pipeline" button appears in the top navigation bar
  3. Click the button and confirm it creates a clone of the pipeline
  4. Verify the button appears in both desktop and mobile views

Additional Comments

The TopNavActionsProvider is designed to be reusable for other context-specific actions that should appear in the global navigation. Actions can be prioritized to control their order in the navigation bar.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@maxy-shpfy maxy-shpfy force-pushed the 01-16-fix_return_clone_pipeline_button_back_to_the_top_menu branch from 3ca33e8 to 9d1be6b Compare January 16, 2026 20:49
@maxy-shpfy maxy-shpfy marked this pull request as ready for review January 16, 2026 20:55
@maxy-shpfy maxy-shpfy requested a review from a team as a code owner January 16, 2026 20:55
@maxy-shpfy maxy-shpfy marked this pull request as draft January 16, 2026 20:57
@maxy-shpfy maxy-shpfy force-pushed the 01-16-fix_return_clone_pipeline_button_back_to_the_top_menu branch from 9d1be6b to 17ea17b Compare January 16, 2026 21:00
@maxy-shpfy maxy-shpfy force-pushed the 01-16-fix_return_clone_pipeline_button_back_to_the_top_menu branch from 17ea17b to 6b826e5 Compare January 16, 2026 21:22
@maxy-shpfy maxy-shpfy marked this pull request as ready for review January 16, 2026 21:29
@camielvs camielvs mentioned this pull request Jan 17, 2026
4 tasks
Copy link
Collaborator

As an alternative solution I have created #1659 which adds a toolbar, with all the pipeline run actions, to the run view that is always visible.

Copy link
Collaborator Author

Closed in favor of #1659

@maxy-shpfy maxy-shpfy closed this Jan 17, 2026
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.

3 participants