Skip to content

Conversation

@Oppen
Copy link
Contributor

@Oppen Oppen commented Dec 16, 2024

Important

This PR requires a new .env variable

Add a new progress bar with inline label telling how much time until the next scheduled batch is pushed.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Testing

  1. Bring up a devnet and its explorer.
  2. Go to the batches page.
  3. At the beginning, it should say something like "10 minutes" (default for dev) with empty (gray) progress bar.
  4. After you send a batch, and then stop sending, you should see the progress bar advanding (green) and the count decreasing, about once a minute.
  5. When the count reaches 0, it should stay at 0, and the bar should be fully green.
  6. When you start sending batches again, it should reset to 10.

You may also play with different timeouts by setting the env var MAX_BATCH_WAIT_MINUTES to different numbers of minutes.

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change batcher/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@Oppen Oppen force-pushed the feat/explorer_time_to_next_batch branch from fb3424e to dc70bbd Compare December 18, 2024 14:47
@Oppen Oppen force-pushed the feat/explorer_time_to_next_batch branch from de876d1 to bc961c5 Compare December 20, 2024 01:50
@Oppen Oppen changed the base branch from staging to explorer-new-version December 20, 2024 01:50
@Oppen Oppen marked this pull request as ready for review December 20, 2024 01:59
@Oppen Oppen changed the title wip: initial work on countdown to next batch feat: progress bar for next batch Dec 20, 2024
MarcosNicolau and others added 7 commits December 20, 2024 11:30
Fixed by setting the preference in a cookie and load it from the server
Also removed target attr as it wasn't needed and was showing warnings when compling
Co-authored-by: Urix <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
@MarcosNicolau
Copy link
Member

MarcosNicolau commented Dec 20, 2024

@Oppen here is a suggestion to avoid clip-path, use tailwind and smooth transitions that should do it:

  def render(assigns) do
    ~H"""
    <div class="w-full relative weight-700 rounded-lg">
      <div class="w-full bg-accent/20 rounded-2xl">
        <p class="ml-2 text-center relative text-foreground font-bold z-10">
          <%= @label %>
        </p>
      </div>
      <div
        class="top-0 left-0 h-full bg-accent p-1 rounded-2xl absolute transition-all"
        style={"width: #{@progress}%"}
      >
      </div>
    </div>
    """
  end

@MarcosNicolau
Copy link
Member

Other than those comments, the update logic worked fantastic.

@Oppen
Copy link
Contributor Author

Oppen commented Dec 20, 2024

@Oppen here is a suggestion to avoid clip-path, use tailwind and smooth transitions that should do it:

  def render(assigns) do
    ~H"""
    <div class="w-full relative weight-700 rounded-lg">
      <div class="w-full bg-accent/20 rounded-2xl">
        <p class="ml-2 text-center relative text-foreground font-bold z-10">
          <%= @label %>
        </p>
      </div>
      <div
        class="top-0 left-0 h-full bg-accent p-1 rounded-2xl absolute transition-all"
        style={"width: #{@progress}%"}
      >
      </div>
    </div>
    """
  end

I can try this, but I don't quite grasp what it does. Also, note the duplicate label is intentional because it remains centered and depending on which half of the bar you see it it needs different styling.

@Oppen Oppen force-pushed the feat/explorer_time_to_next_batch branch from 2c8f1a9 to e0aaba2 Compare December 20, 2024 19:40
@Oppen
Copy link
Contributor Author

Oppen commented Dec 20, 2024

Tried in order:

  1. Replacing clip-path with width: breaks the bar hard.
  2. Your last version with Tailwind: looks much better but contrast on the left side of the bar is a little low:
image

Base automatically changed from explorer-new-version to staging January 2, 2025 18:56
@MarcosNicolau MarcosNicolau requested a review from uri-99 January 2, 2025 19:44
Copy link
Contributor

@uri-99 uri-99 left a comment

Choose a reason for hiding this comment

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

getting this when running the explorer:

Error: other error: %ArithmeticError{message: "bad argument in arithmetic expression"}

which leads to a 500: key :cost_per_proof_chart not found in: %{

Copy link
Contributor

@uri-99 uri-99 left a comment

Choose a reason for hiding this comment

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

add a default value for the new var

@JuArce JuArce added this pull request to the merge queue Jan 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 9, 2025
@JuArce JuArce added this pull request to the merge queue Jan 9, 2025
Merged via the queue into staging with commit 8e6d2c2 Jan 9, 2025
1 check passed
@JuArce JuArce deleted the feat/explorer_time_to_next_batch branch January 9, 2025 17:20
PatStiles added a commit that referenced this pull request Jan 9, 2025
Co-authored-by: Urix <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: PatStiles <[email protected]>
Co-authored-by: Avila Gastón <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: nicolau <[email protected]>
PatStiles added a commit that referenced this pull request Jan 10, 2025
Co-authored-by: Urix <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: PatStiles <[email protected]>
Co-authored-by: Avila Gastón <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: nicolau <[email protected]>
PatStiles added a commit that referenced this pull request Jan 10, 2025
Co-authored-by: Urix <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: PatStiles <[email protected]>
Co-authored-by: Avila Gastón <[email protected]>
Co-authored-by: Marcos Nicolau <[email protected]>
Co-authored-by: nicolau <[email protected]>
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.

7 participants