{# WORKSPACE FILE VIEWER — read-only file content (LEGACY fragment). Rendered by GET /workspace/{key}/file. NOTE: this in-column viewer is no longer wired into the live UI — clicking a tree file now opens the file in the CENTER pane (preview + edit) via openWsFile, matching the prototype. This fragment + its route are retained as a stable read-only JSON-free HTML view of a file but are not reachable from the tree. (No "Edit" button here — editing happens in the center pane.) States: - no file selected (initial) → a hint to pick a file - ws_error (escape / missing) → a clean error panel (NEVER the file) - binary file → "binary file — N bytes" notice - large file (truncated) → content + a "truncated" banner - text file → monospace body with a line-number gutter Vars: file : workspace.read_file() dict, or None ws_error : error message when the read was rejected/failed ws_path : the rel-path that was requested (for the error header) #} {% if ws_error %}
{{ file.content }}