semantics

This commit is contained in:
2026-05-26 09:30:41 +03:00
parent 1e7bcecaea
commit 9ffa8af1dc
623 changed files with 28045 additions and 26557 deletions

View File

@@ -4,11 +4,11 @@
<!--
@SEMANTICS: git, branch, selection, checkout
@PURPOSE: UI для выбора и создания веток Git.
@LAYER: Component
@RELATION: CALLS -> gitService.getBranches
@RELATION: CALLS -> GitServiceBranch
@RELATION: CALLS -> gitService.createBranch
@RELATION: BINDS_TO -> onchange
@LAYER Component
@RELATION CALLS -> [gitService.getBranches]
@RELATION CALLS -> [GitServiceBranch]
@RELATION CALLS -> [gitService.createBranch]
@RELATION BINDS_TO -> [onchange]
-->
<script>
@@ -54,13 +54,13 @@
* @post branches обновлен.
*/
async function loadBranches() {
console.log(`[BranchSelector][Action] Loading branches for dashboard ${dashboardId}`);
console.log(`[EXT:frontend:BranchSelector][Action] Loading branches for dashboard ${dashboardId}`);
loading = true;
try {
branches = await gitService.getBranches(dashboardId, envId);
console.log(`[BranchSelector][Coherence:OK] Loaded ${branches.length} branches`);
console.log(`[EXT:frontend:BranchSelector][Coherence:OK] Loaded ${branches.length} branches`);
} catch (e) {
console.error(`[BranchSelector][Coherence:Failed] ${e.message}`);
console.error(`[EXT:frontend:BranchSelector][Coherence:Failed] ${e.message}`);
toast($t.git?.load_branches_failed, 'error');
} finally {
loading = false;
@@ -86,15 +86,15 @@
* @post currentBranch обновлен, родительский callback вызван.
*/
async function handleCheckout(branchName) {
console.log(`[BranchSelector][Action] Checking out branch ${branchName}`);
console.log(`[EXT:frontend:BranchSelector][Action] Checking out branch ${branchName}`);
try {
await gitService.checkoutBranch(dashboardId, branchName, envId);
currentBranch = branchName;
onchange({ branch: branchName });
toast($t.git?.switched_to?.replace('{branch}', branchName), 'success');
console.log(`[BranchSelector][Coherence:OK] Checked out ${branchName}`);
console.log(`[EXT:frontend:BranchSelector][Coherence:OK] Checked out ${branchName}`);
} catch (e) {
console.error(`[BranchSelector][Coherence:Failed] ${e.message}`);
console.error(`[EXT:frontend:BranchSelector][Coherence:Failed] ${e.message}`);
toast(e.message, 'error');
}
}
@@ -108,16 +108,16 @@
*/
async function handleCreate() {
if (!newBranchName) return;
console.log(`[BranchSelector][Action] Creating branch ${newBranchName} from ${currentBranch}`);
console.log(`[EXT:frontend:BranchSelector][Action] Creating branch ${newBranchName} from ${currentBranch}`);
try {
await gitService.createBranch(dashboardId, newBranchName, currentBranch, envId);
toast($t.git?.created_branch?.replace('{branch}', newBranchName), 'success');
showCreate = false;
newBranchName = '';
await loadBranches();
console.log(`[BranchSelector][Coherence:OK] Branch created`);
console.log(`[EXT:frontend:BranchSelector][Coherence:OK] Branch created`);
} catch (e) {
console.error(`[BranchSelector][Coherence:Failed] ${e.message}`);
console.error(`[EXT:frontend:BranchSelector][Coherence:Failed] ${e.message}`);
toast(e.message, 'error');
}
}

View File

@@ -4,8 +4,8 @@
<!--
@SEMANTICS: git, history, commits, audit
@PURPOSE: Displays the commit history for a specific dashboard.
@LAYER: Component
@RELATION: CALLS -> gitService.getHistory
@LAYER Component
@RELATION CALLS -> [gitService.getHistory]
-->
<script>

View File

@@ -6,8 +6,8 @@
@SEMANTICS: git, commit, modal, version_control, diff
@PURPOSE: Модальное окно для создания коммита с просмотром изменений (diff).
@LAYER: Component
@RELATION: CALLS -> [GitServiceClient]
@LAYER Component
@RELATION CALLS -> [EXT:frontend:GitServiceClient]
@UX_STATE: Ready -> Commit message, status, and diff preview are available for the selected repository.
@UX_STATE: Submitting -> Commit actions stay disabled while the commit request is in flight.
-->

View File

@@ -4,8 +4,8 @@
<!--
@SEMANTICS: git, conflict, resolution, merge
@PURPOSE: UI for resolving merge conflicts (Keep Mine / Keep Theirs).
@LAYER: Component
@RELATION: BINDS_TO -> onresolve
@LAYER Component
@RELATION BINDS_TO -> [EXT:frontend:onresolve]
@INVARIANT: User must resolve all conflicts before saving.
-->
@@ -40,7 +40,7 @@
*/
function resolve(file, strategy) {
console.log(
`[ConflictResolver][Action] Resolving ${file} with ${strategy}`,
`[EXT:frontend:ConflictResolver][Action] Resolving ${file} with ${strategy}`,
);
resolutions[file] = strategy;
resolutions = { ...resolutions }; // Trigger update
@@ -59,7 +59,7 @@
const unresolved = conflicts.filter((c) => !resolutions[c.file_path]);
if (unresolved.length > 0) {
console.warn(
`[ConflictResolver][Coherence:Failed] ${unresolved.length} unresolved conflicts`,
`[EXT:frontend:ConflictResolver][Coherence:Failed] ${unresolved.length} unresolved conflicts`,
);
toast(
`Please resolve all conflicts first. (${unresolved.length} remaining)`,
@@ -69,7 +69,7 @@
}
// 2. Implementation
console.log(`[ConflictResolver][Coherence:OK] All conflicts resolved`);
console.log(`[EXT:frontend:ConflictResolver][Coherence:OK] All conflicts resolved`);
onresolve(resolutions);
show = false;
}

View File

@@ -4,9 +4,9 @@
<!--
@SEMANTICS: deployment, git, environment, modal
@PURPOSE: Modal for deploying a dashboard to a target environment.
@LAYER: Component
@RELATION: CALLS -> GitService
@RELATION: DISPATCHES -> deploy
@LAYER Component
@RELATION CALLS -> [GitService]
@RELATION DISPATCHES -> [deploy]
@INVARIANT: Cannot deploy without a selected environment.
-->
@@ -82,7 +82,7 @@
* @side_effect Updates environments state.
*/
async function loadEnvironments() {
console.log(`[DeploymentModal][Action] Loading environments`);
console.log(`[EXT:frontend:DeploymentModal][Action] Loading environments`);
loading = true;
try {
environments = await api.getEnvironmentsList();
@@ -94,10 +94,10 @@
selectedEnv = (candidates[0]?.id) || "";
}
console.log(
`[DeploymentModal][Coherence:OK] Loaded ${environments.length} environments`,
`[EXT:frontend:DeploymentModal][Coherence:OK] Loaded ${environments.length} environments`,
);
} catch (e) {
console.error(`[DeploymentModal][Coherence:Failed] ${e.message}`);
console.error(`[EXT:frontend:DeploymentModal][Coherence:Failed] ${e.message}`);
toast($t.migration?.loading_envs_failed, "error");
} finally {
loading = false;
@@ -122,7 +122,7 @@
return;
}
}
console.log(`[DeploymentModal][Action] Deploying to ${selectedEnv}`);
console.log(`[EXT:frontend:DeploymentModal][Action] Deploying to ${selectedEnv}`);
deploying = true;
try {
const result = await gitService.deploy(dashboardId, selectedEnv, envId);
@@ -131,9 +131,9 @@
"success",
);
show = false;
console.log(`[DeploymentModal][Coherence:OK] Deployment triggered`);
console.log(`[EXT:frontend:DeploymentModal][Coherence:OK] Deployment triggered`);
} catch (e) {
console.error(`[DeploymentModal][Coherence:Failed] ${e.message}`);
console.error(`[EXT:frontend:DeploymentModal][Coherence:Failed] ${e.message}`);
toast(e.message, "error");
} finally {
deploying = false;

View File

@@ -2,7 +2,7 @@
<!-- @BRIEF Git initialization panel: select config, create remote repo, init local repo. -->
<!-- @LAYER UI -->
<!-- @RELATION DEPENDS_ON -> [GitUtils] -->
<!-- @RELATION CALLS -> [gitService] -->
<!-- @RELATION CALLS -> [EXT:frontend:gitService] -->
<!-- @UX_STATE Idle -> Config selector, remote URL input, create/init buttons. -->
<!-- @UX_STATE Loading -> Buttons disabled, spinner visible. -->
<script>

View File

@@ -6,10 +6,10 @@
<!-- @RELATION USES -> [GitReleasePanel] -->
<!-- @RELATION USES -> [GitOperationsPanel] -->
<!-- @RELATION USES -> [GitMergeDialog] -->
<!-- @RELATION USES -> [BranchSelector] -->
<!-- @RELATION USES -> [DeploymentModal] -->
<!-- @RELATION USES -> [ConflictResolver] -->
<!-- @RELATION CALLS -> [gitService] -->
<!-- @RELATION USES -> [EXT:frontend:BranchSelector] -->
<!-- @RELATION USES -> [EXT:frontend:DeploymentModal] -->
<!-- @RELATION USES -> [EXT:frontend:ConflictResolver] -->
<!-- @RELATION CALLS -> [EXT:frontend:gitService] -->
<!-- @RELATION DEPENDS_ON -> [GitUtils] -->
<!-- @RELATION DEPENDS_ON -> [UseGitManager] -->
<!-- @RATIONALE Decomposed from 1220→~370 lines by extracting sub-panels, utils, and composable handlers per INV_7. -->

View File

@@ -2,7 +2,7 @@
<!-- @BRIEF Unfinished merge recovery dialog: abort, continue, resolve conflicts. -->
<!-- @LAYER UI -->
<!-- @RELATION DEPENDS_ON -> [GitUtils] -->
<!-- @RELATION CALLS -> [gitService] -->
<!-- @RELATION CALLS -> [EXT:frontend:gitService] -->
<!-- @UX_STATE Open -> Dialog with merge context, status, and action buttons. -->
<!-- @UX_STATE Loading -> Recovery state loading spinner. -->
<script>

View File

@@ -2,7 +2,7 @@
<!-- @BRIEF Git release panel: promote branches via MR or direct mode. -->
<!-- @LAYER UI -->
<!-- @RELATION DEPENDS_ON -> [GitUtils] -->
<!-- @RELATION CALLS -> [gitService] -->
<!-- @RELATION CALLS -> [EXT:frontend:gitService] -->
<!-- @UX_STATE Idle -> Pipeline status and promote button. -->
<!-- @UX_STATE Advanced -> Expandable branch/reason settings. -->
<script>

View File

@@ -2,7 +2,7 @@
<!-- @BRIEF Git workspace panel: sync, commit message input, diff viewer, commit action. -->
<!-- @LAYER UI -->
<!-- @RELATION DEPENDS_ON -> [GitUtils] -->
<!-- @RELATION CALLS -> [gitService] -->
<!-- @RELATION CALLS -> [EXT:frontend:gitService] -->
<!-- @UX_STATE Idle -> Commit form with diff viewer. -->
<!-- @UX_STATE Loading -> GeneratingMessage spinner, workspace loading. -->
<!-- @UX_STATE Error -> Toast on failure. -->

View File

@@ -1,7 +1,7 @@
// #region GitManagerUnfinishedMergeIntegrationTest:Module [TYPE Function]
// @SEMANTICS: git-manager, unfinished-merge, dialog, integration-test
// @PURPOSE: Protect unresolved-merge dialog contract in GitManager pull flow.
// @RELATION: DEPENDS_ON -> [GitManager]
// @RELATION DEPENDS_ON -> [GitManager]
import { describe, it, expect } from 'vitest';
import fs from 'node:fs';

View File

@@ -1,6 +1,6 @@
// #region UseGitManager [C:3] [TYPE Module] [SEMANTICS git, handlers, composable, orchestration]
// @BRIEF Composable for GitManager handler functions — extracted to reduce component size per INV_7.
// @RELATION DEPENDS_ON -> [gitService]
// @RELATION DEPENDS_ON -> [EXT:frontend:gitService]
// @RELATION DEPENDS_ON -> [GitUtils]
// @RATIONALE Extracted handler logic from GitManager (1220→~350 lines) to meet INV_7 <150 line contract limit.
import { gitService } from '../../services/gitService';