@windypro-rourou/dsh-logcat 0.5.0-preview.0 → 0.5.0-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +23 -5
  2. package/package.json +48 -48
package/lib/client.js CHANGED
@@ -33,10 +33,13 @@ window.__ModuleLoader__.load({
33
33
  [data-dsh-logcat-entry][data-active] { background: rgba(128,128,128,.22); }
34
34
  [data-dsh-logcat-entry] .lc-entry-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; }
35
35
  [data-dsh-logcat-entry] .lc-entry-label { font-size: 13px; line-height: 1.2; opacity: .92; }
36
- .dsh-logcat-view { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); display: flex; flex-direction: column; background: var(--lc-bg, #ffffff); border-left: 1px solid rgba(128,128,128,.3); box-shadow: -10px 0 28px rgba(0,0,0,.18); z-index: 9999; }
36
+ .dsh-logcat-view { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); z-index: 9999; }
37
37
  .dsh-logcat-view[hidden] { display: none !important; }
38
- .dsh-logcat-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; }
39
- .dsh-logcat-resize:hover, .dsh-logcat-resize[data-drag] { background: rgba(128,128,128,.28); }
38
+ .dsh-logcat-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--lc-bg, #ffffff); border-left: 1px solid rgba(128,128,128,.3); box-shadow: -10px 0 28px rgba(0,0,0,.18); }
39
+ .dsh-logcat-resize { position: absolute; left: -6px; top: 0; bottom: 0; width: 12px; cursor: col-resize; z-index: 2; display: flex; align-items: center; justify-content: center; }
40
+ .dsh-logcat-resize::before { content: ""; width: 3px; height: 48px; border-radius: 2px; background: rgba(128,128,128,.35); transition: background .15s, height .15s; }
41
+ .dsh-logcat-resize:hover::before, .dsh-logcat-resize[data-drag]::before { background: rgba(128,128,128,.75); height: 72px; }
42
+ .dsh-logcat-resize:hover, .dsh-logcat-resize[data-drag] { background: rgba(128,128,128,.16); }
40
43
  .lc-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }
41
44
  .lc-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(128,128,128,.25); flex: none; }
42
45
  .lc-back { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; font-size: 13px; }
@@ -665,6 +668,16 @@ window.__ModuleLoader__.load({
665
668
  };
666
669
  const onDown = (e) => {
667
670
  e.preventDefault();
671
+ if (drag !== null) return;
672
+ // double-click on the handle resets to the default width
673
+ const now = Date.now();
674
+ if (now - (handle?._lastClick ?? 0) < 350) {
675
+ handle._lastClick = 0;
676
+ container.style.width = Math.min(DEFAULT_WIDTH, Math.max(MIN_WIDTH, window.innerWidth - 80)) + "px";
677
+ try { localStorage.setItem("dsh-logcat-width", String(Math.min(DEFAULT_WIDTH, Math.max(MIN_WIDTH, window.innerWidth - 80)))); } catch { /* private */ }
678
+ return;
679
+ }
680
+ handle._lastClick = now;
668
681
  drag = { startX: e.clientX, startWidth: container.getBoundingClientRect().width };
669
682
  handle?.setAttribute("data-drag", "");
670
683
  window.addEventListener("mousemove", onMove);
@@ -677,6 +690,8 @@ window.__ModuleLoader__.load({
677
690
  root = undefined;
678
691
  container?.remove();
679
692
  handle = undefined;
693
+ // Wrapper keeps the resize handle OUTSIDE the React root — createRoot clears
694
+ // the container's children on render, which used to delete the handle.
680
695
  container = document.createElement("div");
681
696
  container.dataset.dshLogcatView = "";
682
697
  container.className = "dsh-logcat-view";
@@ -684,11 +699,14 @@ window.__ModuleLoader__.load({
684
699
  container.hidden = true; // side-drawer: hidden until the sidebar entry is clicked
685
700
  handle = document.createElement("div");
686
701
  handle.className = "dsh-logcat-resize";
687
- handle.title = "拖拽调整宽度";
702
+ handle.title = "拖拽调整宽度(双击重置)";
688
703
  handle.addEventListener("mousedown", onDown);
689
704
  container.appendChild(handle);
705
+ const panel = document.createElement("div");
706
+ panel.className = "dsh-logcat-panel";
707
+ container.appendChild(panel);
690
708
  document.body.appendChild(container);
691
- root = createRoot(container);
709
+ root = createRoot(panel);
692
710
  root.render(h(LogcatPanel, { controller }));
693
711
  };
694
712
 
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@windypro-rourou/dsh-logcat",
3
- "description": "Android Logcat viewer for the dsh web GUI: auto-connects to any adb device in debug mode, live logcat stream with level/keyword filters, pause/clear/export, plus agent tools (logcat_recent). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules copy, no dsh source changes.",
4
- "version": "0.5.0-preview.0",
5
- "type": "module",
6
- "packageManager": "pnpm@11.22.0",
7
- "engines": {
8
- "node": "^22.19.0 || >=24.0.0"
9
- },
10
- "main": "lib/index.js",
11
- "exports": {
12
- ".": {
13
- "default": "./lib/index.js"
14
- },
15
- "./client": {
16
- "default": "./lib/client.js"
17
- },
18
- "./package.json": "./package.json"
19
- },
20
- "dsh": {
21
- "bundle": {
22
- "patch": "./cordis.patch.yml"
23
- },
24
- "client": {
25
- "inject": [
26
- "@deepseek-ai/dsh-client-runtime"
27
- ],
28
- "platform": "web"
29
- }
30
- },
31
- "dependencies": {
32
- "ws": "^8.18.0"
33
- },
34
- "peerDependencies": {
35
- "react": "^18.2.0",
36
- "react-dom": "^18.2.0"
37
- },
38
- "files": [
39
- "lib/**/*.js",
40
- "cordis.patch.yml",
41
- "README.md"
42
- ],
43
- "license": "Apache-2.0",
44
- "repository": {
45
- "type": "git",
46
- "url": "https://github.com/zhu1090093659/dsh-web-ui.git"
47
- }
48
- }
1
+ {
2
+ "name": "@windypro-rourou/dsh-logcat",
3
+ "description": "Android Logcat viewer for the dsh web GUI: auto-connects to any adb device in debug mode, live logcat stream with level/keyword filters, pause/clear/export, plus agent tools (logcat_recent). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules copy, no dsh source changes.",
4
+ "version": "0.5.0-preview.2",
5
+ "type": "module",
6
+ "packageManager": "pnpm@11.22.0",
7
+ "engines": {
8
+ "node": "^22.19.0 || >=24.0.0"
9
+ },
10
+ "main": "lib/index.js",
11
+ "exports": {
12
+ ".": {
13
+ "default": "./lib/index.js"
14
+ },
15
+ "./client": {
16
+ "default": "./lib/client.js"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "dsh": {
21
+ "bundle": {
22
+ "patch": "./cordis.patch.yml"
23
+ },
24
+ "client": {
25
+ "inject": [
26
+ "@deepseek-ai/dsh-client-runtime"
27
+ ],
28
+ "platform": "web"
29
+ }
30
+ },
31
+ "dependencies": {
32
+ "ws": "^8.18.0"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^18.2.0",
36
+ "react-dom": "^18.2.0"
37
+ },
38
+ "files": [
39
+ "lib/**/*.js",
40
+ "cordis.patch.yml",
41
+ "README.md"
42
+ ],
43
+ "license": "Apache-2.0",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/WindyPro-rourou/dsh-logcat.git"
47
+ }
48
+ }