Skip to content

Embed TimeLiner schedules in .nwc files as XML, not CSV - #150

Merged
mahach666 merged 1 commit into
IOExtend:mainfrom
menes97:fix/embedded-timeliner-data-loss
Nov 12, 2026
Merged

mahach666 merged 1 commit into
IOExtend:mainfrom
menes97:fix/embedded-timeliner-data-loss

Conversation

@menes97

@menes97 menes97 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #36

The TimeLiner stream that NwcWriter embeds in a .nwc file held the schedule as CSV. That lost the schedule name, the task hierarchy, progress, node links and multi-line task names.

  • NwcStreamSerializer.BuildTimeLinerStream now writes the existing TimeLiner XML format (NwcTimeLinerXmlSerializer) into the same [100][106][count][length][payload] frame.
  • TimeLinerParser looks at the first non-whitespace character of the payload. It reads XML when that character is <, and the legacy CSV otherwise, so files written by earlier versions still open. A direct (unframed) payload is handled the same way.

Compatibility note: earlier NwcIO versions read the embedded payload as CSV, so they won't read a schedule embedded by this version. Standalone CSV import and export are unchanged.

Tests (TimeLinerTests):

  • TimeLinerSchedule_NwcRoundtrip_PreservesTaskTreeAndMetadata: saves and reopens a document in memory. Checks the schedule name, nested tasks, progress, node links and a multi-line task name. Fails without the src change ("TimeLiner Schedule" instead of "My Schedule").
  • TimeLinerSchedule_OpensLegacyEmbeddedCsv: builds a legacy CSV payload by hand and checks it still opens. It passes before and after.

dotnet build NwcIO.slnx succeeds, and NwcIO.Tests passes locally: 241 passed, and 2 skipped because they need private Navisworks files (.NET 10.0.400 on Windows, with global.json pinned down to it temporarily; not committed).

The change was drafted with OpenAI Codex, then reviewed and verified with Claude Code.

🤖 Generated with Claude Code

The embedded CSV lost the schedule name, the task hierarchy, progress,
node links and multi-line task names. The writer now embeds the
existing TimeLiner XML format, and the reader detects XML and still
reads the legacy CSV payload.

Fixes IOExtend#36

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mahach666
mahach666 merged commit e0161da into IOExtend:main Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TimeLiner schedules saved to .nwc lose hierarchy, progress, node links, schedule name and multi-line tasks (embedded payload is lossy CSV)

2 participants