Page MenuHomeFreeBSD

[DNM] contrib/bsddialog: import version 1.2 rendering and API improvements
Needs ReviewPublic

Authored by dteske on Thu, Jul 9, 6:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 14, 7:07 AM
Unknown Object (File)
Sun, Jul 12, 10:32 PM
Unknown Object (File)
Sun, Jul 12, 3:53 PM
Unknown Object (File)
Sat, Jul 11, 8:41 PM
Subscribers

Details

Summary

Introduce a scrollback-safe screen update model for ncurses dialogs:
enter the alternate-screen buffer by default, paint the themed backdrop
once via dialog_backdrop_sync(), and route physical updates through
dialog_flush(), dialog_flush_overlay(), dialog_flush_widget(), and
dialog_flush_stdscr(). Prefer werase(3) over wclear(3), paint dialog
shadows as an L-shape, and untouchwin(3) stdscr(3) before doupdate(3)
so bkgd(3) does not emit clear_screen (CSI-H CSI-2J) into scrollback.

Add a persistent gauge API (bsddialog_gauge_open/update/flush/close) for
embedders that repaint the same gauge without tearing down curses state.
Split draw_dialog() into dialog_place(), dialog_paint_frame(), and
dialog_repaint_text(). Handle KEY_BTAB (Shift+Tab) for backward focus
navigation. Calendar opens with the day grid focused instead of buttons.

Bump LIBBSDDIALOG_VERSION to 1.2, update CHANGELOG, and adjust example
scripts (gauge/mixedgauge arithmetic, pause/rangebox height, library
compile/clean helpers).

Tested by running the contrib/bsddialog examples_utility/*.sh suite.

Test Plan

Build and install, then go into examples_utility and run ln -sf /usr/bin/bsddialog to link ./bsddialog to /usr/bin/bsddialog then run the example scripts (*.sh)

In each example script, use arrows, TAB, Shift+TAB, keystrokes to confirm expected functionality.

After each example script, scroll up (or press Scroll-Lock and page up) to ensure that the scroll back is not polluted.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74642
Build 71525: arc lint + arc unit

Event Timeline

dteske requested review of this revision.Thu, Jul 9, 6:29 AM
dteske edited the test plan for this revision. (Show Details)
dteske edited the test plan for this revision. (Show Details)EditedThu, Jul 9, 6:37 AM

This work also supports the incoming bsdpv(3) library and bsdpv(1) utility -- which is dpv(3)/dpv(1) rebuilt to use bsddialog(1) instead of cdialog(1) that was removed from base

I don't see any of this upstream at https://gitlab.com/alfix/bsddialog, nor even as a merge request there?

Hi, I’m on vacation right now. I’ll have a look next week since reading on my phone is a bit uncomfortable.

dteske retitled this revision from contrib/bsddialog: import version 1.2 rendering and API improvements to [DNM] contrib/bsddialog: import version 1.2 rendering and API improvements.Sat, Jul 11, 2:55 PM

I don't see any of this upstream at https://gitlab.com/alfix/bsddialog, nor even as a merge request there?

Hi Jessica, to clarify: this review is intentionally a DNM (Do Not Merge) patch for local staging and refinement.

Because bsddialog is critical to base system tools like dpv/bsdpv, bsdinstall, bsdconfig, sade, etc, the goal here is to use our native infrastructure to vet the API fixes with Alfonso first. Once the technical implementation is finalized here, the clean patch will be exported and submitted to the upstream GitLab repository.

When Alfonso imports the vendor update back into FreeBSD, the final commit will cross-reference this Phabricator review. This hybrid approach allows us to:

  1. Refine base-system impacts using our standard project tools without forcing committers into external 'dual-citizenship' workflows.
  2. Establish a permanent, two-way historical provenance in our own tree that remains intact even if external git hosting platforms change or go down.

I am leaving this open for discussion here until Alfonso gets back from vacation next week to review the logic.

Ok, so long as everyone's in agreement that this ultimately needs to land in FreeBSD as a vendor import of a new upstream release, I'm happy