Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Test input helper
run: |
bash -n tests/automation/bcon-test-input
python3 -B -W error::ResourceWarning -m unittest discover -s tests/automation -p 'test_*.py' -v

- uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
Expand Down
123 changes: 67 additions & 56 deletions HANDOFF.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,69 @@
# Agent Handoff

Status: Active — review complete; v1.5.0 merge and release pending.

## Goal

Merge the reviewed display rotation (#17), NumLock-off keypad navigation (#18),
and related rendering/config fixes. The user authorized merging and necessary
documentation updates. The user also explicitly authorized a release. Use v1.5.0 because rotation adds
a feature. All commit, PR, release, and issue messages must be English.
Leave issue #19 unchanged.
After release, reply to #17 and #18 in English, briefly apologizing for the slow reply
(as requested by the user). Do not send those replies before release.

## Completed

- Reviewed all application, documentation, and test-tool changes.
- Fixed review findings: relative-path config watch filtering, grayscale mode
selection and R8-to-RGB atlas upload, and out-of-bounds absolute pointer input
after rotation. Added regression coverage.
- Fixed final-target handling in the interactive pointer check and NumLock
restoration in the keypad check.
- Updated English/Japanese configuration, keybind, and installation docs;
added an Unreleased changelog section and tests/README.md.
- Earlier systemd visual smoke run: 12 screenshots showed correct text, colors,
Sixel, both Kitty transfers, partial update cleanup, and alternate-screen
restoration. Service had zero restarts during that run. This predates the
additional code-review fixes; screenshots do not verify all rotation angles
or VT switching animations.

## Verification

- `cargo test --locked`: 65 passed, 1 hardware-dependent seatd test ignored.
- `cargo test --locked --no-default-features`: passed.
- `cargo build --release --locked`: passed after the review fixes.
- Shell/Python parsing and both C test utilities' strict syntax checks passed.
- Relative-config atomic-save regression failed before the fix and passed after.
- User reports overnight stress did not reproduce issue #19; not proof of a fix.

## Next steps

- Publish the reviewed branch/PR, verify CI, merge, tag v1.5.0, and verify the
release artifacts. Then reply to issues #17 and #18 in English with a brief
apology for the slow reply. Update this handoff once complete.
- Update this file after merge so future agents do not repeat stale work.

## Uncommitted files and blockers

- Changes are being prepared on a dedicated review branch. Check git status and
the PR before resuming. No application restart is needed for GitHub operations.
- The development share is CIFS and reports every file as executable. Preserve
existing Git modes; ignore mode-only differences when reviewing/staging.
- Privileged deployment requires the user's sudo interaction. The user offered
to execute commands themselves; never request their password.

- CIFS rejected writing loose Git objects during staging. A local review clone
is recorded in /tmp/bcon-review-path; it has the same reviewed file contents
and preserves repository file modes. Use it for publication if needed.
Status: No active task. Input helper and focused screenshot fix verified locally.

## User direction

- Prioritize stability and focused bug reviews with reproducible tests. Defer
issues #5/#6; leave #19 unchanged unless instructed otherwise.
- Operate via Codex started over SSH on the Linux test machine, whether Parallels
or physical hardware. Use actual bcon input/captures for feature/app checks.
- All commit, PR, release and issue messages must be English.
- Never push/tag without an explicit instruction. No new publication requested.

## Completed in this working tree

- tests/automation/probe.py: read-only environment inventory.
- input_helper.py: sudo bootstrap opens uinput and pins the target bcon PID;
drops UID/GID, then serves bounded keyboard requests on a private Unix socket.
Peer UID checks, release-on-interruption, VT/process guard, and cleanup.
- bcon-test-input shell launcher, symlinked into /home/hiro/.local/bin; works
from any directory. No-argument invocation starts helper via sudo for tty2.
- tests/automation/test_input_helper.py: 18 protocol/lifecycle tests passed.
- src/main.rs: moved PNG capture from the content FBO to after screen composition,
just before buffer swap, within presentation guards. Success flash starts after
capture. No other product source changed.
- cargo test --locked: 65 passed, 1 hardware-dependent seatd test ignored.
- cargo build --release --locked: passed (CIFS cache hard-link warning in tests).
- User installed binary and restarted bcon: PID 20247, start 12:45:23 JST.
Installed SHA256 55308c4bf690505d26d0fbc0ab314022360dcc6ec308f0ebc1bc5b97323f41eb.
- Live helper test confirms new PNGs contain tab bar, divider, terminal cursor,
and 42% progress overlay. Focus, zoom/unzoom and test-tab closure exercised.
PID stayed 20247 and restart count stayed 0. Original login/shell tab restored.

## Environment and evidence

- Helper remains running in the user's separate SSH session; query status before
using it and reserve the seat exclusively. It pins the PID, so restart helper
after bcon restarts. User stops it with Ctrl+C.
- User added [paths] screenshot_dir to /etc/bcon/config.toml. Do not append again.
Directory /home/hiro/.local/state/bcon-test/screenshots: hiro:hiro, 0700;
PNG files root:root, 0644, readable by hiro but directory excludes other users.
- Evidence/report: composed-frame-regression.md in that screenshot directory.
The earlier first-helper-check.md describes the pre-fix run.
- Both focus states have tab-background RGBA (31,31,38,255) at (20,920),
divider RGBA (76,76,89,255) at (512,300). A fleeting visual suspicion of a
missing tab bar was disproved by PNG pixel checks; it is not a known defect.

## Limits and possible future work

- CI runs the helper protocol/lifecycle tests and shell syntax check.
- No complete application scenario runner or automatic PNG collector yet.
- Hardware pointer planes are outside screenshots. Rotation, sync-update
deferral, VT recovery and host-display flicker were not live-tested here.
- Earlier lines move out of view on split/unzoom and reappear on zoom. Observed
before and after the screenshot fix; separate resize/reflow review candidate.
- Earlier pane-close logs reported SIGHUP/SIGKILL timeouts; not diagnosed here.
- Do not silently expand into rendering refactors or mark these candidates fixed.

## Working tree / publication

- Change includes src/main.rs, tests/README.md, tests/automation/, HANDOFF.md,
and CI coverage for the input helper. No release or tag is requested.
- CIFS reports all files executable. Use git -c core.filemode=false status/diff
and preserve tracked modes when staging. The shell launcher needs executable mode.
- Main baseline is v1.5.0, e3751738f4361cea94b081a2ae7b0e3483321d0c.
- Earlier PR #20 merged and v1.5.0 released; artifact checksums verified.
- Issue replies already posted; do not repeat:
https://github.com/sanohiro/bcon/issues/17#issuecomment-5842086768
https://github.com/sanohiro/bcon/issues/18#issuecomment-5842088706
46 changes: 25 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6280,27 +6280,6 @@ Make sure seatd/logind is running and you're on an active VT."
text_renderer.flush(gl, &glyph_atlas, screen_w, screen_h);
}

// Bell flash is drawn after FBO blit (outside FBO cache)

// === Screenshot ===
if take_screenshot {
take_screenshot = false;
let user_home = term.user_home_dir();
if let Err(e) = save_screenshot(
gl,
display_config.width,
display_config.height,
&cfg.paths.screenshot_dir,
user_home.as_deref(),
) {
log::warn!("Screenshot save failed: {}", e);
} else {
// Flash on success
bell_flash_until =
Some(std::time::Instant::now() + Duration::from_millis(BELL_FLASH_DURATION_MS));
}
}

// === Pane dividers (drawn in FBO, after all pane content) ===
// Only draw divider lines between panes (not around outer edges)
if !pane_dividers.is_empty() && any_content_dirty {
Expand Down Expand Up @@ -6957,6 +6936,31 @@ Make sure seatd/logind is running and you're on an active VT."
}
}

// Capture the composed default framebuffer, including the tab bar,
// terminal cursor and overlays, before swapping it out. Keep the
// request pending while synchronized updates or VT state defer
// presentation. DRM hardware cursor planes are not part of this PNG.
if take_screenshot {
take_screenshot = false;
let user_home = term.user_home_dir();
if let Err(e) = save_screenshot(
gl,
display_config.width,
display_config.height,
&cfg.paths.screenshot_dir,
user_home.as_deref(),
) {
log::warn!("Screenshot save failed: {}", e);
} else {
// Acknowledge on the next frame so this capture does not
// include its own success flash.
bell_flash_until = Some(
std::time::Instant::now()
+ Duration::from_millis(BELL_FLASH_DURATION_MS),
);
}
}

egl_context.swap_buffers()?;

// Get front buffer and display to DRM
Expand Down
4 changes: 4 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Interactive checks

For SSH-driven application testing, see [automation/README.md](automation/README.md).
It includes a read-only environment probe and a temporary sudo-started keyboard
helper for use from a separate SSH session.

Run these inside bcon on a text VT, including a session started through
`bcon@tty2.service`. A terminal window or SSH session alone cannot verify bcon's
rendering or local keyboard handling. Stop a test before switching VTs when it
Expand Down
Loading
Loading