← Back to Journal

Interactive Image Role Selection Fix

Validated the portable image-role workflow through real use and fixed interactive selection cancelling immediately.

Tags: Abbey Root • Abbey Framework • Developer Toolkit • Plant Model

Interactive Image Role Selection Fix

Summary

The new portable image-role command worked through its non-interactive options, but its first normal interactive test exposed a problem.

Running:

abbey plant hero martha-my-dear

listed the available photographs and then immediately cancelled instead of waiting for a numbered selection.

The embedded Python program was being passed through standard input with python3 -. The program later tried to use that same standard input for input(), but the Python source heredoc had already consumed it.

The selector now reads its embedded Python program from file descriptor 3, leaving standard input available for the person running the command.

Accomplishments

Impact

Interactive image-role selection now works through the intended command:

abbey plant hero <slug>

The user can choose a numbered image and confirm the change without supplying non-interactive command-line options.

Because the correction is in the generic image-role selector, future configured image roles receive the same fixed behavior.

The real test also validated the complete publishing chain from canonical metadata through the built website.

Lessons Learned

End-to-end testing found a defect that the initial fixture tests missed.

The earlier tests covered cancellation and non-interactive selection, but they did not prove that a person could enter a number at the prompt. Interactive commands need at least one test that follows the same standard-input path used during normal operation.

An embedded program should not consume standard input when it also needs to prompt the user. Giving the program source its own file descriptor keeps those two input streams separate.

The stable public hero filename also means a browser may continue displaying a cached image after publishing. Restarting the preview server or performing a hard refresh makes the replacement visible.

Next Steps