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
43 changes: 38 additions & 5 deletions graphcode-windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,45 @@ the new support directory rather than reusing the parent's explicit override.
The parent's environment and other inherited variables remain unchanged.
The native New Workspace sheet shows the resolved directory, a separate-window
diagram titled with the typed name, and workspace-isolation details. Invalid or
colliding names stay inline with Create & Open disabled; an empty draft stays
quiet, and Cancel discards it. Ctrl+A selects the complete focused name field
colliding names stay inline with Create & Open disabled. Only a literal empty
draft stays quiet; a nonempty whitespace-only draft reports
"Give the workspace a name — letters and numbers." Cancel discards the draft.
The diagram trims Foundation `.whitespaces`, including zero-width space, but
not `.newlines`; trimming affects only the preview, never the raw name passed
to validation or creation. Ctrl+A selects the complete focused name field
without changing ordinary typing or AltGr handling. Creation and launch still
use the existing workspace lifecycle and identity guards. Windows keeps its
existing ASCII normalization and 48-character limit rather than adopting the
macOS transliteration and truncation rules.
use the existing workspace lifecycle and identity guards.

New workspace names follow macOS's operation order: transliterate to Latin,
strip nonspacing diacritics, lowercase, map characters other than ASCII letters
and numbers to separators, collapse separators, and take the first 32 characters. The cut
can end in a hyphen. Preview, submit-time validation, and creation share this
creation-only rule, including file/directory collisions after transliteration
or truncation. Windows absolute-path validation and filesystem errors still
apply; the Darwin socket-path limit does not apply to Windows named pipes.
Inline collision errors and the submit-to-create race status identify the actual
creation slug: "A workspace named cafe-zurich already exists." These messages
own their storage and propagate allocation failures; operational and
Windows-specific path errors keep their existing failure routes.
The native implementation uses Windows' built-in ICU C API, loaded only from
System32 (the combined DLL is available since Windows 10 1903, before the
Windows 11 baseline and Server 2022/2025 CI hosts). Missing ICU, missing exports,
or failed transforms report an operational error, never an ASCII fallback.
The 27 checked naming fixtures were produced by compiling the actual shared
`Workspace.slug` method with pinned Swift/Foundation 6.3.3. They establish finite
fixture equivalence, not equality for every Unicode character across OS/ICU
versions, nor a live native input or paired macOS visual qualification.
The actual macOS preview method and shared naming-error enum were also compiled
with that pinned Foundation: 12 preview/validation examples and an exhaustive
19-scalar `.whitespaces` set agree with the existing `SketchPromotion.trim`
helper used by this sheet. Headless tests separately retain newlines, refuse
invalid drafts without creating directories, and cover owned-message and preview
lifetimes under allocation failure. This does not establish live input, glyph
rendering, or native dialog qualification.
Existing directories retain their original names, paths, identities, and
discovery/activation behavior; nothing is migrated or renamed. Explicit Rename
keeps its existing ASCII normalization and 48-character limit.

Selecting the current workspace does nothing; selecting an identified running
workspace restores its exact window rather than the first GraphCode window.
`Ctrl+Alt+PageUp` / `Ctrl+Alt+PageDown` and Previous/Next Workspace cycle only
Expand Down
22 changes: 16 additions & 6 deletions graphcode-windows/src/App.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10189,12 +10189,22 @@ pub const App = struct {
defer result.deinit(self.allocator);
if (!self.ensureWorkspaceIdentity()) return;
var workspace = WorkspaceLifecycle.create(self.allocator, result.name, home) catch |err| {
self.setStatus(switch (err) {
error.EmptyName => "Workspace name is required",
error.NameTooLong => "Workspace name is too long",
error.NameTaken, error.PathAlreadyExists => "That workspace already exists",
else => "Workspace could not be created",
});
const problem: ?WorkspaceLifecycle.NameError = switch (err) {
error.EmptyName => error.EmptyName,
error.InvalidName => error.InvalidName,
error.NameTooLong => error.NameTooLong,
error.NameTaken, error.PathAlreadyExists => error.NameTaken,
else => null,
};
if (problem) |name_problem| {
const message = WorkspaceLifecycle.nameProblemMessage(self.allocator, name_problem, result.name) catch |message_error| {
std.log.err("Workspace creation failed ({s}); naming error message failed: {s}", .{ @errorName(err), @errorName(message_error) });
self.setStatus("Workspace name error could not be displayed");
return;
};
defer self.allocator.free(message);
self.setStatus(message);
} else self.setStatus("Workspace could not be created");
return;
};
defer workspace.deinit(self.allocator);
Expand Down
Loading
Loading