Skip to content

Avatar covers Run tests when the editor toolbar wraps to two rows #131

Description

@EnjouWang

Problem

On the interview page, Jim's avatar (#jim-stage) can sit on top of the Run tests button. The CSS comment above .jim-stage in web/styles.css says the stage is placed "clear of the toolbar, so it never covers Run tests", but that only holds while .editor-toolbar is a single row.

Image

Steps to reproduce

  1. Open an interview in a window about 1210–1240px wide (the avatar is hidden at 1200px and below). The exact range shifts with the installed fonts, since it depends on where the toolbar wraps.
  2. Look at the right side of the editor toolbar.

Actual: the toolbar wraps to two rows, Run tests moves onto the second row at the right edge, and the avatar covers almost all of it.
Expected: the avatar stays below the toolbar at every width it is shown.

Cause

.jim-stage uses a fixed top: 4.25rem, which only clears a single-row toolbar. Because .jim-stage has pointer-events: none, a click on the covered area still reaches the button, so this is a visibility problem: the button is there but the candidate cannot see it.

Proposed fix

Derive the stage's top from the toolbar's actual bottom instead of a constant:

.jim-stage { top: var(--jim-stage-top, 4.25rem); }
const toolbar = document.querySelector(".editor-toolbar");
const placeJimStage = () => {
  const bottom = toolbar.getBoundingClientRect().bottom;
  document.documentElement.style.setProperty("--jim-stage-top", `${Math.ceil(bottom) + 6}px`);
};
new ResizeObserver(placeJimStage).observe(toolbar);
window.addEventListener("resize", placeJimStage);
placeJimStage();

In Chrome's responsive mode, this removed the overlap at every width I tried.

Follow-up proposal: let the candidate move the avatar

In a real video interview the candidate can usually move the interviewer's video tile. A movable avatar would also cover layouts nobody has measured yet, e.g. once #125 lets the editor get narrower.

The avatar contract says the stage takes no pointer events so it can never swallow a click meant for the editor. To keep that property:

  • Only a small drag handle gets pointer-events: auto; the rest of the stage stays click-through.
  • Snap to the four corners of the editor area rather than free placement, clamped so the stage never overlaps the toolbar or the test drawer.
  • Re-clamp on resize; save the chosen corner with readStored / writeStored from web/audio-output.js, as Resizable sidebar on the interview page #125 proposes for the sidebar width.
  • The handle is keyboard operable with an accessible name.
  • Update the "Placement and pose" section of docs/avatar-contract.md.

This part is a separate design question and could be its own issue if the maintainers prefer to land the fix first.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

help wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions