Checkpoint source 7 workflows and in-progress diagram authoring redesign
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
Preserve current core, source, REST, desktop, recovery, documentation and validation work, including AGENTS.md and the development summary. This is a work-in-progress checkpoint: the new compact palette has outstanding compilation errors and native acceptance; earlier passing gates retain their documented scope.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
pub(crate) mod architecture_authoring;
|
||||
#[cfg(test)]
|
||||
mod architecture_authoring_tests;
|
||||
mod checkpoints;
|
||||
#[cfg(test)]
|
||||
mod diagram_selection_tests;
|
||||
@@ -314,6 +317,7 @@ pub struct FilePrompt {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Message {
|
||||
Architecture(architecture_authoring::Event),
|
||||
Home(crate::home::Event),
|
||||
CheckpointTick,
|
||||
CheckpointWritten(Id, Result<(), String>),
|
||||
@@ -329,6 +333,7 @@ pub enum Message {
|
||||
ExactStrings(bool),
|
||||
Page(Page),
|
||||
Guide(crate::guide::Event),
|
||||
Traceability(crate::views::traceability::Event),
|
||||
Behavior(crate::behavior::Event),
|
||||
Layer(Layer),
|
||||
Select(Id),
|
||||
@@ -450,6 +455,7 @@ pub struct App {
|
||||
/// Home resumes this page; explicit Architecture navigation remains separate.
|
||||
last_workspace_page: Page,
|
||||
pub guide: crate::guide::State,
|
||||
pub traceability: crate::views::traceability::State,
|
||||
pub behavior: crate::behavior::State,
|
||||
pub data_state: crate::data_view::State,
|
||||
pub inspector_tab: crate::navigation::InspectorTab,
|
||||
@@ -460,6 +466,8 @@ pub struct App {
|
||||
pub active_diagram: Option<Id>,
|
||||
pub search: String,
|
||||
pub create_kind: Kind,
|
||||
pub architecture: Option<architecture_authoring::State>,
|
||||
pub architecture_palette_expanded: bool,
|
||||
pub status: String,
|
||||
pub busy: bool,
|
||||
pub pending: Option<Pending>,
|
||||
@@ -548,6 +556,7 @@ impl App {
|
||||
page: Page::Diagram,
|
||||
last_workspace_page: Page::Diagram,
|
||||
guide: crate::guide::State::default(),
|
||||
traceability: Default::default(),
|
||||
behavior: Default::default(),
|
||||
data_state: Default::default(),
|
||||
inspector_tab: Default::default(),
|
||||
@@ -557,6 +566,8 @@ impl App {
|
||||
draft,
|
||||
active_diagram,
|
||||
search: String::new(),
|
||||
architecture: None,
|
||||
architecture_palette_expanded: false,
|
||||
create_kind: if layer == Layer::Sa {
|
||||
Kind::Function
|
||||
} else {
|
||||
@@ -623,6 +634,7 @@ impl App {
|
||||
}
|
||||
pub fn dirty(&self) -> bool {
|
||||
self.document.dirty()
|
||||
|| self.architecture.is_some()
|
||||
|| self.workflow.is_some()
|
||||
|| self.draft_dirty()
|
||||
|| self.source_dirty()
|
||||
@@ -1051,6 +1063,39 @@ impl App {
|
||||
])
|
||||
}
|
||||
pub fn update(&mut self, message: Message) -> Task<Message> {
|
||||
if matches!(&message, Message::Connection(_))
|
||||
&& self
|
||||
.architecture
|
||||
.as_ref()
|
||||
.is_some_and(architecture_authoring::State::unnamed_tool)
|
||||
{
|
||||
self.architecture = None;
|
||||
self.canvas_epoch = self.canvas_epoch.wrapping_add(1);
|
||||
}
|
||||
// Named placement owns input. Passive geometry/checkpoints continue;
|
||||
// navigation and close retain raw input until explicit completion/cancel.
|
||||
if self.architecture.is_some() {
|
||||
if matches!(message, Message::Escape) {
|
||||
self.architecture = None;
|
||||
self.canvas_epoch = self.canvas_epoch.wrapping_add(1);
|
||||
return Task::none();
|
||||
}
|
||||
let placing = self.architecture.as_ref().is_some_and(|s| s.saved.placing);
|
||||
if !matches!(
|
||||
&message,
|
||||
Message::Architecture(_)
|
||||
| Message::CheckpointTick
|
||||
| Message::CheckpointWritten(..)
|
||||
| Message::Lint(_)
|
||||
| Message::Linted(..)
|
||||
| Message::WindowResized(_)
|
||||
| Message::CanvasResized(_)
|
||||
) && !(placing && matches!(&message, Message::Pan(_) | Message::Zoom(_)))
|
||||
{
|
||||
self.status = "Finish placing this element or Cancel (Esc) before leaving. Your name is retained.".into();
|
||||
return Task::none();
|
||||
}
|
||||
}
|
||||
// Scrollable geometry can change while async work or an overlay blocks
|
||||
// commands. Keep the observed translation current; its passive handler
|
||||
// still validates document, scenario and revision before accepting it.
|
||||
@@ -1303,6 +1348,7 @@ impl App {
|
||||
}
|
||||
fn handle(&mut self, message: Message) -> Task<Message> {
|
||||
match message {
|
||||
Message::Architecture(event) => return self.architecture_event(event),
|
||||
Message::Home(event) => return self.home_event(event),
|
||||
Message::CheckpointTick => return self.checkpoint_tick(),
|
||||
Message::CheckpointWritten(id, result) => {
|
||||
@@ -1718,6 +1764,13 @@ impl App {
|
||||
self.refresh_draft();
|
||||
}
|
||||
}
|
||||
Message::Traceability(event) => {
|
||||
self.traceability.update(event);
|
||||
return iced::widget::operation::snap_to(
|
||||
"traceability-list",
|
||||
iced::widget::scrollable::RelativeOffset::START,
|
||||
);
|
||||
}
|
||||
Message::Search(value) => {
|
||||
self.search = value;
|
||||
self.explorer_page = 0;
|
||||
@@ -1910,6 +1963,10 @@ impl App {
|
||||
if t.request.sources.first().is_some_and(|source|
|
||||
crate::behavior::selected_behavior(self.project(), *source).is_some()));
|
||||
let previous_behavior_context = self.state_view_identity();
|
||||
let requested_destination = match &workflow {
|
||||
crate::workflow::Workflow::Transition(t) => t.request.destination_diagram,
|
||||
_ => None,
|
||||
};
|
||||
match workflow.update(self.project(), event) {
|
||||
Ok(Some(mut candidate)) => {
|
||||
let focus = transition_focus
|
||||
@@ -1932,7 +1989,24 @@ impl App {
|
||||
.and_then(|id| crate::behavior::selected_behavior(&candidate, id));
|
||||
let destination = focus.and_then(|id| {
|
||||
candidate.layer_of(id).and_then(|layer| {
|
||||
preferred_diagram(&candidate, self.active_diagram, layer, id)
|
||||
requested_destination
|
||||
.filter(|view| {
|
||||
candidate.diagrams.get(view).is_some_and(|d| {
|
||||
(d.layer == layer
|
||||
|| d.projection == ProjectionKind::Traceability)
|
||||
&& d.nodes
|
||||
.values()
|
||||
.any(|node| node.element == id)
|
||||
})
|
||||
})
|
||||
.or_else(|| {
|
||||
preferred_diagram(
|
||||
&candidate,
|
||||
self.active_diagram,
|
||||
layer,
|
||||
id,
|
||||
)
|
||||
})
|
||||
})
|
||||
});
|
||||
if let (None, Some(id), Some(diagram)) =
|
||||
|
||||
Reference in New Issue
Block a user