DEV Community

Cover image for The Button Is Visible. When Can You Actually Tap It?
FinoGeeks Insights
FinoGeeks Insights

Posted on

The Button Is Visible. When Can You Actually Tap It?

A blue button appears in a startup recording. You stop the timer on that frame. In the next frame a finger lands on the button. The counter underneath still says zero. Which part of the startup did you just measure?

FinClip’s initial rendering cache makes that distinction worth investigating. On a repeat open, its view layer can draw the initial page from a saved rendering while the logic layer is still starting. FinClip documents a period during which the cached page is visible and cannot yet respond to user events. A screenshot can therefore be authentic evidence of a faster-looking launch while telling you very little about the first useful interaction. FinClip view layer, section 11

We built a one-button Mini App and compiled it twice with the compiler supplied with FinClip Studio. Then we tested a measurement procedure in a separate headless browser, where we could deliberately hold the click handler back. Those two exercises answer different questions. The builds tell us whether the setting reached the compiled page. The browser lets us check whether our measurements can distinguish visible from interactive. We did not run this pair on a phone, so the time from launch to a working tap in a FinClip host remains an open measurement.

Start with a button that can prove it heard you

Give the page a local action with an unmistakable result. Our button increments a counter. It needs no account, network call, animation or backend. An extra increment also tells us if a supposedly lost tap eventually arrived.

<view>
  <button bindtap="recordTap">Count one tap</button>
  <text>Accepted: {{count}}</text>
</view>
Enter fullscreen mode Exit fullscreen mode
Page({
  data: { count: 0 },
  recordTap() {
    const count = this.data.count + 1
    console.log('tap-handled', count, Date.now())
    this.setData({ count })
  }
})
Enter fullscreen mode Exit fullscreen mode

Register the page in app.json and build this exact page twice. Use an empty page configuration for the control. Put {"initialRenderingCache":"static"} in the page JSON for the treatment. Our two builds used FinClip Studio 3.0.6.1817’s Blender compiler 1.1.0. Both produced an app package. In the generated pageframe.js, the probe page carried the static rendering flag in the treatment and had no such flag in the control. Checking the build catches the easy mistake of comparing two packages produced with the same setting.

The zero matters here. In static mode, FinClip records the view produced from the page’s initial data. Subsequent changes made through setData are outside that static rendering. A cached picture of “Accepted: 0” therefore makes sense even if a previous visit ended at three. If you put a customer’s changing balance or the state of an order in that position, you have a much harder question to answer about what the first frame means. Static initial rendering cache

Check that the test can see a missed tap

Before spending time on device recordings, we wanted to know whether the test itself would hide the bug it was supposed to detect. For a desktop control we put a button at fixed coordinates. Each run started in a fresh browser context. We opened the page once, installed its handler, then reloaded it. In one variant the first visit saved the initial button markup and the second visit restored it before attaching a handler. In the other variant the same spot stayed white until we installed the handler and created the button.

To recreate the control, serve this little fixture on localhost. Open it with ?mode=static for the saved-markup variant and ?mode=off for the other. Use a fresh browser context for each variant, call finishBoot() once to prime the page, and reload before starting the sequence below.

<style>
  button {position:absolute; left:20px; top:20px; width:160px;
          height:60px; background:#1455b4; color:white; border:0}
  output {position:absolute; top:96px}
</style>
<main></main>
<script>
  const cacheOn = new URL(location.href).searchParams.get('mode') === 'static'
  const root = document.querySelector('main')
  const markup = '<button>Count one tap</button><output>0</output>'
  if (cacheOn) root.innerHTML = localStorage.getItem('initial-markup') || ''
  window.handled = []
  window.finishBoot = () => {
    if (!root.querySelector('button')) root.innerHTML = markup
    if (cacheOn) localStorage.setItem('initial-markup', markup)
    root.querySelector('button').onclick = () => {
      window.handled.push(performance.now())
      root.querySelector('output').textContent = window.handled.length
    }
  }
</script>
Enter fullscreen mode Exit fullscreen mode

We held initialization behind that explicit test signal. It gave us time to take a screenshot and send one click to the same coordinates in both variants. No selector waited for a button to appear. We verified the blue fill by sampling a screenshot pixel inside the button and away from its label. Then we released initialization, checked whether the early click had been counted, and sent a second click. This is the core sequence in Playwright:

const earlyFrame = await page.screenshot()
await page.mouse.click(40, 45)
const earlyCount = await page.evaluate(() => window.handled.length)

await page.evaluate(() => window.finishBoot())
const countBeforeSecondClick = await page.evaluate(() => window.handled.length)
await page.mouse.click(40, 45)
const finalCount = await page.locator('output').textContent()
Enter fullscreen mode Exit fullscreen mode

Across three paired runs in desktop Edge 158, we reversed the order in the middle pair. The result was consistent.

Observation on the repeat open No saved markup Saved markup
Screenshot contained button pixels before initialization 0/3 3/3
Early click counted before initialization 0/3 0/3
Early click counted after initialization, before a second click 0/3 0/3
Second click changed the displayed counter to one 3/3 3/3

These counts validate the probe. If a test only waited for a visible button and then declared the page ready, it would pass during the deliberately inactive phase in all three saved-markup runs. If it waited for app readiness before injecting every click, it would conceal the same gap. We recorded each screenshot interval and the time the handler ran on the browser’s own clock. The test itself chose when initialization could finish, so subtracting those times would tell you about the test harness. It could not tell you how many milliseconds this option saves on Android or iOS.

Take the same question to a phone

Install the two builds in turn in the same compatible host and keep the device, host build, Mini App base library, entry page and network conditions fixed. Record those versions with your observations. For each configuration, open the probe once so it has had an opportunity to generate a cache. End that Mini App instance, then reopen it from the same entry. Simply sending the host to the background can leave the original running instance available for a hot start. Clearing all application storage between priming and reopening can remove the very thing you are testing. FinClip also notes that an update or storage reclamation may invalidate a cached rendering. Startup behavior · Cache lifecycle

On the recording, mark the action that starts the Mini App, the first frame showing the button, the first attempted touch and the first frame in which the counter increments. Use a touch indicator or a camera that can see both the finger and the screen. The counter change is the first visible acknowledgement of that tap. The handler log is useful corroboration, but its clock and the video clock have different origins. At 60 frames per second, events that appear in adjacent frames are roughly one frame apart. Giving that difference to the nearest millisecond would suggest precision the recording does not have.

Try a single early tap and then leave the screen alone long enough to see whether the counter eventually moves. In a separate repeat, tap after the page has settled to check that the handler actually works. Record an early touch that produced no later acknowledgement as its own outcome. A second successful touch cannot tell you what happened to the first. The desktop control dropped its early click. FinClip’s documentation describes when the page can respond, but does not specify a universal replay policy for every host, so let the device evidence answer that part.

Choose what deserves to appear early

A stable heading or the outline of a form can orient someone during startup. An apparently active control makes a stronger promise. For a page whose principal job is to accept an immediate tap, track both the appearance of that control and the user’s first acknowledged action. If the first moves earlier and the second stays put, the change improved the visual wait. Decide whether that is enough for this page.

One small design change is worth testing alongside the cache setting. Start the probe with a neutral loading label or a visibly disabled control in its initial data. Show the active control when its prerequisites are ready. The screen can still explain where the user has landed, and the difference between the two startup milestones is now legible to the person holding the phone.

Top comments (0)