mbeditor 0.7.3 → 0.7.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 720ab9c5f06c65a444d4e7a4d9204926a91e31941ed5d21df9a8cb234c322124
4
- data.tar.gz: 3c31e3387d38ba23e997dd71051328678bd225ea6ec2078c7d8cae72b44b09c6
3
+ metadata.gz: 3b37033b1cdb05394d9c3c94d28354444ba4d568bcfd57eeb76a582ee4d0812b
4
+ data.tar.gz: ea68220e640e5cc57c76f0acf94519a83fde7852ffc8954880527ff108206870
5
5
  SHA512:
6
- metadata.gz: aa5177a8fb2e8511a4452dc33d3965c5838001991883360e2767ad598edefcb0b3f4feeeb54cd9692b0d7e7527cdf87463faeef2713edcb48cdd672aadfc961b
7
- data.tar.gz: 1634701e852db9e3273f0217e5268c6298f3443fdfc5b598d53cfff6a462771a754c7f4ed187cbc247429e0d19ba27913d188715e3846856c034f3382facab5b
6
+ metadata.gz: 8f1626f3030541e44974c2d44fb7b10ebe37d23664015cfb163f8e9c3b7b8fe9e3e85f9c9f0c2372ced7ab6adad37cd50e6856b0c18d8f0574510695d2e39443
7
+ data.tar.gz: 892e64bcda023182e76cbb6a95830caabfcf54c9e4fbb59aca26334df2ee6bb8434edf6be97b57576089661b6d1a98d27390d816043eb70e8508ad6efca8fbd2
data/CHANGELOG.md CHANGED
@@ -5,10 +5,24 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.5] - 2026-06-03
9
+
10
+ ### Fixed
11
+ - **What's New tab restored blank** — `isChangelog` was stripped during periodic tab persistence (`MbeditorApp.js:1540`), so the changelog tab was restored without the flag on page reload. The pane rendered it as a normal file tab (Monaco) instead of `ChangelogView`. Added `isChangelog` to the serialized tab properties and patched `openChangelogTab` to set the flag on any restored tabs that lack it.
12
+
13
+ ---
14
+
15
+ ## [0.7.4] - 2026-06-03
16
+
17
+ ### Fixed
18
+ - **Custom path reverse lookup (frontend)** — the v0.7.3 backend fix was complete, but the frontend's `resourceLabelFromPath` still returned `null` for paths under `app/` that weren't `controllers|models|views|helpers`, so custom paths like `app/assets/javascripts/…` were never recognized. Moved the custom-path check to the top of the function, matching the backend approach.
19
+
20
+ ---
21
+
8
22
  ## [0.7.3] - 2026-06-03
9
23
 
10
24
  ### Fixed
11
- - **Custom path reverse lookup** — moved the custom-path check in `extract_resource_names` before the `case` statement so paths under `app/assets/`, `app/javascript/`, etc. are handled. Stripped `_controller`/`_model`/`_helper`/`_service` suffixes from custom-path filenames in both backend and frontend for consistent label/grouping.
25
+ - **Custom path reverse lookup (backend)** — moved the custom-path check in `extract_resource_names` before the `case` statement so paths under `app/assets/`, `app/javascript/`, etc. are handled. Stripped `_controller`/`_model`/`_helper`/`_service` suffixes from custom-path filenames for consistent label/grouping.
12
26
  - **Schema modal `self.table_name` support** — reads `self.table_name` from the model file before falling back to `ActiveSupport::Inflector.tableize`, enabling custom table names.
13
27
  - **Structure.sql broader schema-prefix regex** — handles quoted schemas, non-public schemas, and no prefix.
14
28
  - **PostgreSQL type coverage** — expanded `sql_type_to_rails` with full PostgreSQL type coverage (timestamptz, double precision, citext, hstore, geometric types, etc.).
@@ -1549,6 +1549,7 @@ var MbeditorApp = function MbeditorApp() {
1549
1549
  dirty: t.dirty,
1550
1550
  viewState: t.viewState,
1551
1551
  isSettings: !!t.isSettings,
1552
+ isChangelog: !!t.isChangelog,
1552
1553
  isPreview: !!t.isPreview,
1553
1554
  previewFor: t.previewFor || null,
1554
1555
  isDiff: !!t.isDiff,
@@ -1610,6 +1611,26 @@ var MbeditorApp = function MbeditorApp() {
1610
1611
 
1611
1612
  var resourceLabelFromPath = function(p) {
1612
1613
  if (!p) return null;
1614
+
1615
+ // Custom paths are checked first so they work regardless of top-level prefix.
1616
+ // Paths under app/assets/, app/javascript/, etc. never match standard
1617
+ // app/controllers|models|views|helpers, so the check must happen first.
1618
+ var customPaths = customPathsRef.current;
1619
+ for (var ci = 0; ci < customPaths.length; ci++) {
1620
+ var base = customPaths[ci];
1621
+ if (p.startsWith(base + '/')) {
1622
+ var rest = p.slice(base.length + 1);
1623
+ var resource = rest.split('/')[0].replace(/\.[^.]+$/, '');
1624
+ resource = resource.replace(/_(controller|model|helper|service)$/, '');
1625
+ if (resource) {
1626
+ var seg = resource.replace(/ies$/, 'y')
1627
+ .replace(/([^aeiou])es$/, '$1')
1628
+ .replace(/([^s])s$/, '$1');
1629
+ return seg.replace(/_/g, ' ').replace(/\b\w/g, function(c) { return c.toUpperCase(); });
1630
+ }
1631
+ }
1632
+ }
1633
+
1613
1634
  var parts = p.split('/');
1614
1635
  var file = parts[parts.length - 1];
1615
1636
  var name;
@@ -1624,22 +1645,9 @@ var MbeditorApp = function MbeditorApp() {
1624
1645
  else if (parts[1] === 'models') name = file.replace(/_(test|spec)\.rb$/, '');
1625
1646
  else return null;
1626
1647
  } else {
1627
- // Check custom paths
1628
- var customPaths = customPathsRef.current;
1629
- for (var ci = 0; ci < customPaths.length; ci++) {
1630
- var base = customPaths[ci];
1631
- if (p.startsWith(base + '/')) {
1632
- var rest = p.slice(base.length + 1);
1633
- var resource = rest.split('/')[0].replace(/\.[^.]+$/, '');
1634
- // Strip Rails-style suffixes so custom-path files group with their controller/model
1635
- resource = resource.replace(/_(controller|model|helper|service)$/, '');
1636
- if (resource) { name = resource; break; }
1637
- }
1638
- }
1639
- if (!name) return null;
1648
+ return null;
1640
1649
  }
1641
1650
  var seg = (name || '').split('/').pop() || name || '';
1642
- // Normalize plural→singular so views/users and models/user share one group
1643
1651
  seg = seg.replace(/ies$/, 'y')
1644
1652
  .replace(/([^aeiou])es$/, '$1')
1645
1653
  .replace(/([^s])s$/, '$1');
@@ -3031,8 +3039,18 @@ var MbeditorApp = function MbeditorApp() {
3031
3039
  }
3032
3040
  });
3033
3041
  if (foundTab) {
3042
+ // If the tab was restored from a persisted state that didn't include
3043
+ // isChangelog (pre-v0.7.4), patch it so the pane renders ChangelogView.
3034
3044
  var switchPanes = st.panes.map(function(p) {
3035
- if (p.id === foundPaneId) return Object.assign({}, p, { activeTabId: CHANGELOG_TAB_ID });
3045
+ if (p.id === foundPaneId) {
3046
+ var patchedTabs = p.tabs.map(function(t) {
3047
+ if (t.id === CHANGELOG_TAB_ID && !t.isChangelog) {
3048
+ return Object.assign({}, t, { isChangelog: true });
3049
+ }
3050
+ return t;
3051
+ });
3052
+ return Object.assign({}, p, { tabs: patchedTabs, activeTabId: CHANGELOG_TAB_ID });
3053
+ }
3036
3054
  return p;
3037
3055
  });
3038
3056
  EditorStore.setState({ panes: switchPanes, focusedPaneId: foundPaneId });
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mbeditor
4
- VERSION = "0.7.3"
4
+ VERSION = "0.7.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan