From a8b90f2f012c5b5eb67fee0a9300de31729fdeea Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Thu, 27 Aug 2015 18:09:10 -0700 Subject: [PATCH 01/20] sorting ui --- pub/work/src/css/main.css | 45 +++++++++++++------ pub/work/src/css/main.styl | 44 ++++++++++++------ pub/work/src/css/mobile.styl | 1 - .../src/js/components/ItemComponent.coffee | 2 +- pub/work/src/js/main.js | 17 +------ 5 files changed, 65 insertions(+), 44 deletions(-) diff --git a/pub/work/src/css/main.css b/pub/work/src/css/main.css index 71e9f3fcb..4346f818e 100644 --- a/pub/work/src/css/main.css +++ b/pub/work/src/css/main.css @@ -101,6 +101,12 @@ button { h1 { font-weight: 500; } +input, +button, +.input { + outline: none; + border: 0; +} h1.leader:after { content: "—"; margin-left: 0.6rem; @@ -139,7 +145,6 @@ h1.leader:after { vertical-align: middle; } .ctrl .sort { - outline: none; border: 0; cursor: pointer; background-color: #000; @@ -184,6 +189,7 @@ h1.leader:after { } .item { display: block; + min-height: 3rem; max-height: 3rem; margin-bottom: 1.5rem; width: 36rem; @@ -193,7 +199,8 @@ h1.leader:after { } .item .description, .item .discussion { - display: none; + transition: visibility 0s linear 200ms; + visibility: hidden; } .item.expand { max-height: 24rem; @@ -201,7 +208,8 @@ h1.leader:after { } .item.expand .description, .item.expand .discussion { - display: inherit; + transition: visibility 0s; + visibility: visible; } .item .expand { margin-left: 2rem; @@ -240,7 +248,17 @@ h1.leader:after { font-size: 0.7rem; } .item .sort { - color: #ccc; + opacity: 0; + width: 1rem; + height: 0.2rem; + background-color: #e0e0e0; + border-top: 0.2rem solid #ccc; + border-bottom: 0.2rem solid #ccc; + margin: 0 0.5rem; + margin-top: -0.6rem; +} +.item:hover .sort { + opacity: 1; } .item .done { margin-top: 0.5rem; @@ -275,19 +293,20 @@ h1.leader:after { .item .audience .input { background-color: transparent; } -.item .sort { - font-size: 0.6rem; - width: 2rem; - text-align: center; +.item .title, +.item .date, +.item .tags { + overflow: hidden; + white-space: nowrap; + height: 2rem; } .item .title { min-width: 16rem; margin-left: 0.5rem; } -.item .date { - min-width: 6rem; -} +.item .date, .item .tags { + max-width: 6rem; min-width: 6rem; } .item .description, @@ -325,7 +344,7 @@ h1.leader:after { letter-spacing: 0.07rem; color: #fff; border: 0; - padding: 0 0.3rem; + padding: 0.6rem 0.3rem; margin-top: 0.5rem; } .comment { @@ -358,7 +377,6 @@ h1.leader:after { text-decoration: underline; } .input { - outline: none; padding: 0 0.6rem 0 0.3rem; background-color: #ececec; border: 0; @@ -461,7 +479,6 @@ textarea:focus, max-width: 6rem; overflow: hidden; margin-left: 0.3rem; - height: 2rem; } .item .expand { float: right; diff --git a/pub/work/src/css/main.styl b/pub/work/src/css/main.styl index 966d723a2..a7083a210 100644 --- a/pub/work/src/css/main.styl +++ b/pub/work/src/css/main.styl @@ -23,6 +23,12 @@ button h1 font-weight 500 +input +button +.input + outline none + border 0 + h1.leader:after content "—" margin-left .6rem @@ -61,7 +67,6 @@ h1.leader:after vertical-align middle .sort - outline none border 0 cursor pointer background-color #000 @@ -108,6 +113,7 @@ h1.leader:after .item display block + min-height 3rem max-height 3rem margin-bottom 1.5rem width 36rem @@ -117,7 +123,8 @@ h1.leader:after .description .discussion - display none + transition visibility 0s linear 200ms + visibility hidden &.expand max-height 24rem @@ -125,7 +132,8 @@ h1.leader:after .description .discussion - display inherit + transition visibility 0s + visibility visible .expand margin-left 2rem @@ -164,7 +172,17 @@ h1.leader:after font-size .7rem .sort - color #ccc + opacity 0 + width 1rem + height .2rem + background-color #e0e0e0 + border-top .2rem solid #ccc + border-bottom .2rem solid #ccc + margin 0 .5rem + margin-top -.6rem + + &:hover .sort + opacity 1 .done margin-top .5rem @@ -198,20 +216,21 @@ h1.leader:after .audience .input background-color transparent - - .sort - font-size .6rem - width 2rem - text-align center + + .title + .date + .tags + overflow hidden + white-space nowrap + height 2rem .title min-width 16rem margin-left .5rem .date - min-width 6rem - .tags + max-width 6rem min-width 6rem .description @@ -248,7 +267,7 @@ h1.leader:after letter-spacing .07rem color #fff border 0 - padding 0 .3rem + padding .6rem .3rem margin-top .5rem .comment @@ -282,7 +301,6 @@ h1.leader:after text-decoration underline .input - outline none padding 0 .6rem 0 .3rem background-color #ececec border 0 diff --git a/pub/work/src/css/mobile.styl b/pub/work/src/css/mobile.styl index 405500d6a..58f5fa107 100644 --- a/pub/work/src/css/mobile.styl +++ b/pub/work/src/css/mobile.styl @@ -65,7 +65,6 @@ max-width 6rem overflow hidden margin-left .3rem - height 2rem .item .expand float right diff --git a/pub/work/src/js/components/ItemComponent.coffee b/pub/work/src/js/components/ItemComponent.coffee index 0f9bfee47..c32d62822 100644 --- a/pub/work/src/js/components/ItemComponent.coffee +++ b/pub/work/src/js/components/ItemComponent.coffee @@ -126,7 +126,7 @@ module.exports = recl ) (@renderField 'audience', {}, @formatAudience) ) - (div {className:'sort ib top'}, @props.item.sort) + (div {className:'sort ib'}, '') (button {className:'done ib done-'+(@props.item.done is true), onClick:@_markDone}, '') (@renderTopField 'title', {@onFocus,@onKeyDown}) (@renderTopField 'date_due', {className:'date'}, @formatDate) diff --git a/pub/work/src/js/main.js b/pub/work/src/js/main.js index bd2fb3d7f..bc682a542 100644 --- a/pub/work/src/js/main.js +++ b/pub/work/src/js/main.js @@ -174,7 +174,6 @@ module.exports = { }; - },{"../dispatcher/Dispatcher.coffee":9,"../persistence/Persistence.coffee":15,"../util.coffee":17}],2:[function(require,module,exports){ var WorkActions, div, rece, recl, ref, textarea, slice = [].slice; @@ -339,7 +338,6 @@ module.exports = recl({ }); - },{"../actions/WorkActions.coffee":1}],3:[function(require,module,exports){ var button, div, h1, label, rece, recl, ref; @@ -454,7 +452,6 @@ module.exports = recl({ }); - },{}],4:[function(require,module,exports){ var Field, WorkActions, button, div, rece, recl, ref, textarea; @@ -635,8 +632,8 @@ module.exports = recl({ }, status), div({ className: 'action a' }, action)), this.renderField('audience', {}, this.formatAudience)), div({ - className: 'sort ib top' - }, this.props.item.sort), button({ + className: 'sort ib' + }, ''), button({ className: 'done ib done-' + (this.props.item.done === true), onClick: this._markDone }, ''), this.renderTopField('title', { @@ -702,7 +699,6 @@ module.exports = recl({ }); - },{"../actions/WorkActions.coffee":1,"./FieldComponent.coffee":2}],5:[function(require,module,exports){ var FilterComponent, ItemComponent, ListeningComponent, SortComponent, WorkActions, WorkStore, div, h1, input, rece, recl, ref, textarea; @@ -951,7 +947,6 @@ module.exports = recl({ }); - },{"../actions/WorkActions.coffee":1,"../stores/WorkStore.coffee":16,"./FilterComponent.coffee":3,"./ItemComponent.coffee":4,"./ListeningComponent.coffee":6,"./SortComponent.coffee":7}],6:[function(require,module,exports){ var div, h1, input, rece, recl, ref, textarea; @@ -970,7 +965,6 @@ module.exports = recl({ }); - },{}],7:[function(require,module,exports){ var button, div, h1, label, rece, recl, ref; @@ -1015,7 +1009,6 @@ module.exports = recl({ }); - },{}],8:[function(require,module,exports){ var ListComponent, div, h1, rece, recl, ref; @@ -1038,7 +1031,6 @@ module.exports = recl({ }); - },{"./ListComponent.coffee":5}],9:[function(require,module,exports){ var Dispatcher; @@ -1060,7 +1052,6 @@ module.exports = _.merge(new Dispatcher(), { }); - },{"flux":11}],10:[function(require,module,exports){ var WorkComponent; @@ -1073,7 +1064,6 @@ $(function() { }); - },{"./components/WorkComponent.coffee":8,"./util.coffee":17}],11:[function(require,module,exports){ /** * Copyright (c) 2014-2015, Facebook, Inc. @@ -1471,7 +1461,6 @@ module.exports = { }; - },{}],16:[function(require,module,exports){ var Dispatcher, EventEmitter, WorkStore, _filters, _ghost, _list, _listening, _sorts, _tasks, _updated, assign, uuid32; @@ -1732,7 +1721,6 @@ WorkStore.dispatchToken = Dispatcher.register(function(p) { module.exports = WorkStore; - },{"../dispatcher/Dispatcher.coffee":9,"../util.coffee":17,"events":18,"object-assign":14}],17:[function(require,module,exports){ module.exports = { uuid32: function() { @@ -1791,7 +1779,6 @@ module.exports = { }; - },{}],18:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // From 3c39233ef9be32ab73fe21ec7c38b7182964b618 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Thu, 27 Aug 2015 18:53:10 -0700 Subject: [PATCH 02/20] localstorage --- pub/work/src/js/actions/WorkActions.coffee | 21 ++++- .../src/js/components/FilterComponent.coffee | 9 +- .../src/js/components/ListComponent.coffee | 7 +- .../src/js/components/SortComponent.coffee | 1 + pub/work/src/js/main.js | 87 +++++++++++++++---- .../src/js/persistence/Persistence.coffee | 7 ++ pub/work/src/js/stores/WorkStore.coffee | 10 ++- 7 files changed, 114 insertions(+), 28 deletions(-) diff --git a/pub/work/src/js/actions/WorkActions.coffee b/pub/work/src/js/actions/WorkActions.coffee index 01a6b9fde..c6116355c 100644 --- a/pub/work/src/js/actions/WorkActions.coffee +++ b/pub/work/src/js/actions/WorkActions.coffee @@ -48,12 +48,29 @@ module.exports = version += 1 Persistence.put old:{id,version,dif:add:comment:val} - setFilter: (key,val) -> Dispatcher.handleViewAction {type:'setFilter', key,val} - setSort: (key,val) -> Dispatcher.handleViewAction {type:'setSort',key,val} + setFilter: (key,val,filters) -> + Dispatcher.handleViewAction {type:'setFilter', key,val} + filters[key] = val + Persistence.setLocal 'filters',filters + + setSort: (key,val,sorts) -> + Dispatcher.handleViewAction {type:'setSort',key,val} + sorts[key] = val + Persistence.setLocal 'sorts',sorts + moveItem: (list,to,from) -> Persistence.put {sort:list} Dispatcher.handleViewAction {type:'moveItems',list,to,from} + getLocal: (key)-> + Persistence.getLocal key,(e,r) -> + new Error(e) if e + return if r is null + obj = + type:"load#{key[0].toUpperCase()+key.slice(1)}" + obj[key] = r + Dispatcher.handleServerAction obj + listenList: (type)-> Persistence.subscribe type, (err,d)-> if d? diff --git a/pub/work/src/js/components/FilterComponent.coffee b/pub/work/src/js/components/FilterComponent.coffee index 1259b6c23..82350752d 100644 --- a/pub/work/src/js/components/FilterComponent.coffee +++ b/pub/work/src/js/components/FilterComponent.coffee @@ -16,8 +16,8 @@ module.exports = recl if e.keyCode is 13 e.stopPropagation() e.preventDefault() - onKeyUp: (e) -> @change(e) - onBlur: (e) -> @change(e) + onKeyUp: (e) -> @change e + onBlur: (e) -> @change e change: (e) -> $t = $(e.target).closest('.filter') txt = $t.find('.input').text().trim() @@ -38,6 +38,9 @@ module.exports = recl render: -> (div {className:'filters'}, @fields.map ({filter,key,title})=> + txt = @props.filters[key] + txt = txt?.replace(/\~/g,"") if key is 'creator' + (div {key, 'data-key':key, className:"#{filter} filter ib"}, (label {}, title) switch filter @@ -53,5 +56,5 @@ module.exports = recl @onKeyDown @onKeyUp @onBlur - },@props.filters[filter]) + },txt) )) diff --git a/pub/work/src/js/components/ListComponent.coffee b/pub/work/src/js/components/ListComponent.coffee index afe369619..27a9302d5 100644 --- a/pub/work/src/js/components/ListComponent.coffee +++ b/pub/work/src/js/components/ListComponent.coffee @@ -17,7 +17,6 @@ module.exports = recl noNew:WorkStore.noNew() canSort:WorkStore.canSort() fulllist:WorkStore.getFullList() - listening:WorkStore.getListening() sorts:WorkStore.getSorts() filters:WorkStore.getFilters() expand:false @@ -107,14 +106,16 @@ module.exports = recl _changeListening: -> - _changeFilter: (key,val) -> WorkActions.setFilter key,val + _changeFilter: (key,val) -> WorkActions.setFilter key,val,@state.filters - _changeSort: (key,val) -> WorkActions.setSort key,val + _changeSort: (key,val) -> WorkActions.setSort key,val,@state.sorts componentDidMount: -> @placeholder = $ "
x
" WorkStore.addChangeListener @_onChangeStore WorkActions.listenList @props.list + WorkActions.getLocal 'filters' + WorkActions.getLocal 'sorts' @alias() componentDidUpdate: (_props,_state)-> diff --git a/pub/work/src/js/components/SortComponent.coffee b/pub/work/src/js/components/SortComponent.coffee index bb30c29a0..535200fdf 100644 --- a/pub/work/src/js/components/SortComponent.coffee +++ b/pub/work/src/js/components/SortComponent.coffee @@ -11,6 +11,7 @@ module.exports = recl else if sor is 1 then sor = -1 else if sor is -1 then sor = 0 @props.onChange key,sor + render: -> (div {className:'sorts'}, _.map @props.sorts,(state,key) => (button { diff --git a/pub/work/src/js/main.js b/pub/work/src/js/main.js index bc2ffc83a..b2a55036b 100644 --- a/pub/work/src/js/main.js +++ b/pub/work/src/js/main.js @@ -43,14 +43,14 @@ module.exports = { }); }, setItem: function(arg, key, val) { - var id, obj, set, version; + var id, obj1, set, version; id = arg.id, version = arg.version; version += 1; key = key.split('_').join('-'); set = ( - obj = {}, - obj["" + key] = val, - obj + obj1 = {}, + obj1["" + key] = val, + obj1 ); Persistence.put({ old: { @@ -69,7 +69,7 @@ module.exports = { }); }, ownItem: function(arg, act) { - var id, obj, version; + var id, obj1, version; id = arg.id, version = arg.version; version += 1; return Persistence.put({ @@ -78,9 +78,9 @@ module.exports = { version: version, dif: { doer: ( - obj = {}, - obj["" + act] = null, - obj + obj1 = {}, + obj1["" + act] = null, + obj1 ) } } @@ -141,19 +141,23 @@ module.exports = { } }); }, - setFilter: function(key, val) { - return Dispatcher.handleViewAction({ + setFilter: function(key, val, filters) { + Dispatcher.handleViewAction({ type: 'setFilter', key: key, val: val }); + filters[key] = val; + return Persistence.setLocal('filters', filters); }, - setSort: function(key, val) { - return Dispatcher.handleViewAction({ + setSort: function(key, val, sorts) { + Dispatcher.handleViewAction({ type: 'setSort', key: key, val: val }); + sorts[key] = val; + return Persistence.setLocal('sorts', sorts); }, moveItem: function(list, to, from) { Persistence.put({ @@ -166,6 +170,22 @@ module.exports = { from: from }); }, + getLocal: function(key) { + return Persistence.getLocal(key, function(e, r) { + var obj; + if (e) { + new Error(e); + } + if (r === null) { + return; + } + obj = { + type: "load" + (key[0].toUpperCase() + key.slice(1)) + }; + obj[key] = r; + return Dispatcher.handleServerAction(obj); + }); + }, listenList: function(type) { return Persistence.subscribe(type, function(err, d) { var ref, sort, tasks; @@ -431,8 +451,12 @@ module.exports = recl({ className: 'filters' }, this.fields.map((function(_this) { return function(arg) { - var filter, key, title; + var filter, key, title, txt; filter = arg.filter, key = arg.key, title = arg.title; + txt = _this.props.filters[key]; + if (key === 'creator') { + txt = txt != null ? txt.replace(/\~/g, "") : void 0; + } return div({ key: key, 'data-key': key, @@ -451,7 +475,7 @@ module.exports = recl({ onKeyDown: this.onKeyDown, onKeyUp: this.onKeyUp, onBlur: this.onBlur - }, this.props.filters[filter]); + }, txt); } }).call(_this)); }; @@ -741,7 +765,6 @@ module.exports = recl({ noNew: WorkStore.noNew(), canSort: WorkStore.canSort(), fulllist: WorkStore.getFullList(), - listening: WorkStore.getListening(), sorts: WorkStore.getSorts(), filters: WorkStore.getFilters(), expand: false, @@ -888,15 +911,17 @@ module.exports = recl({ }, _changeListening: function() {}, _changeFilter: function(key, val) { - return WorkActions.setFilter(key, val); + return WorkActions.setFilter(key, val, this.state.filters); }, _changeSort: function(key, val) { - return WorkActions.setSort(key, val); + return WorkActions.setSort(key, val, this.state.sorts); }, componentDidMount: function() { this.placeholder = $("
x
"); WorkStore.addChangeListener(this._onChangeStore); WorkActions.listenList(this.props.list); + WorkActions.getLocal('filters'); + WorkActions.getLocal('sorts'); return this.alias(); }, componentDidUpdate: function(_props, _state) { @@ -1476,6 +1501,19 @@ module.exports = { if (cache != null) { return cb(null, cache); } + }, + setLocal: function(key, val) { + return window.localStorage.setItem(key, JSON.stringify(val)); + }, + getLocal: function(key, cb) { + var e, out; + try { + out = JSON.parse(window.localStorage.getItem(key)); + return cb(null, out); + } catch (_error) { + e = _error; + return cb(e); + } } }; @@ -1643,8 +1681,12 @@ WorkStore = assign({}, EventEmitter.prototype, { } return _tasks[item.id] = this.itemFromData(item, index); }, - getListening: function() { - return _listening; + loadFilters: function(arg) { + var filters; + filters = arg.filters; + console.log('filters'); + console.log(filters); + return _filters = filters; }, getFilters: function() { return _filters; @@ -1654,6 +1696,13 @@ WorkStore = assign({}, EventEmitter.prototype, { key = arg.key, val = arg.val; return _filters[key] = val; }, + loadSorts: function(arg) { + var sorts; + sorts = arg.sorts; + console.log('load sorts'); + console.log(sorts); + return _sorts = sorts; + }, getSorts: function() { return _sorts; }, diff --git a/pub/work/src/js/persistence/Persistence.coffee b/pub/work/src/js/persistence/Persistence.coffee index de1db17de..b07cb48ee 100644 --- a/pub/work/src/js/persistence/Persistence.coffee +++ b/pub/work/src/js/persistence/Persistence.coffee @@ -12,3 +12,10 @@ module.exports = subscribe: (key,cb) -> listeners[key] = cb (cb null,cache) if cache? + setLocal: (key,val) -> window.localStorage.setItem key,JSON.stringify val + getLocal: (key,cb) -> + try + out = JSON.parse window.localStorage.getItem key + cb null,out + catch e + cb e diff --git a/pub/work/src/js/stores/WorkStore.coffee b/pub/work/src/js/stores/WorkStore.coffee index 682388670..df5c450f8 100644 --- a/pub/work/src/js/stores/WorkStore.coffee +++ b/pub/work/src/js/stores/WorkStore.coffee @@ -90,10 +90,18 @@ WorkStore = assign {},EventEmitter.prototype,{ throw new Error "Collision: already have #{item.id}" _tasks[item.id] = @itemFromData item, index - getListening: -> _listening + loadFilters: ({filters}) -> + console.log 'filters' + console.log filters + _filters = filters getFilters: -> _filters setFilter: ({key,val}) -> _filters[key] = val + + loadSorts: ({sorts}) -> + console.log 'load sorts' + console.log sorts + _sorts = sorts getSorts: -> _sorts setSort: ({key,val}) -> for k,v of _sorts From ef4803fb912fd999931e58afc0ff71fda4efd96a Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 28 Aug 2015 13:01:25 -0400 Subject: [PATCH 03/20] fix some stuff --- ape/work.hoon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ape/work.hoon b/ape/work.hoon index 9ded76b68..f1a0b2b89 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -72,6 +72,8 @@ :: ++ send-create (send %create tax) ++ send-change |* * + ?: =(our creator.tax) + (send-update +(version.tax) our +<) %+ send-audience [[creator.tax (main creator.tax)] ~ ~] [%change id.tax +<] @@ -228,6 +230,9 @@ action=action tax=tax == + ?: (lte version.action version.tax.u.tax) + ~& %really-bad-version + [~ +>.$] :- ~ %_ +>.$ unordered From d92988a84d69dc69cf6213bda03dddccd876ef17 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 31 Aug 2015 16:10:58 -0700 Subject: [PATCH 04/20] Review notes. --- ape/work.hoon | 3 +++ sur/talk.hoon | 4 ++-- sur/work.hoon | 11 ++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ape/work.hoon b/ape/work.hoon index f1a0b2b89..6258fdf1d 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -311,6 +311,9 @@ :: :: XX maybe need to check that we haven't received this message before :: by keeping a counter of last message received +:: XX definitely do this! +:: XX handle and test the disconnection case +:: ++ diff-talk-report |= [way=wire rep=report:talk] ^- [(list move) _+>.$] diff --git a/sur/talk.hoon b/sur/talk.hoon index 8940f1630..8b01ee97c 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -91,9 +91,9 @@ [%set-date-due wen=(unit ,@da)] :: set due date [%set-tags tag=(set ,@t)] :: set tags [%set-title til=@t] :: set title - [%set-description des=@t] :: set description + [%set-description des=@t] :: XX (list ,@t) :: set description [%set-done don=?] :: set done - [%add-comment com=@t] :: add comment + [%add-comment com=@t] :: XX (list ,@t) :: add comment == :: ++ task :: $: id=@uvH :: diff --git a/sur/work.hoon b/sur/work.hoon index 2b5b1ddb3..fc8f62d54 100644 --- a/sur/work.hoon +++ b/sur/work.hoon @@ -1,3 +1,8 @@ +:: +:::: /hoon/work/sur + :: + :: A block comment might go here! + :: /- talk |% ++ client @@ -20,20 +25,20 @@ date-due=(unit ,@da) done=(unit ,@da) title=@t - description=@t + description=@t :: XX (list ,@t) discussion=(list comment) == ++ comment $: date=@da ship=@p - body=@t + body=@t :: XX (list ,@t) == ++ command $% [%new audience=(set station:talk) task] [%old id=@uvH dif=update] [%sort p=(list ,@uvH)] == -++ update +++ update :: XX rename, web-edit? $% $: %set $% [%audience to=(set station:talk)] [%date-due p=(unit ,@da)] From 09966db7b570f6789c3b84a76bfb4e424a69ef57 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 31 Aug 2015 20:18:07 -0400 Subject: [PATCH 05/20] bump protocol to 3 --- arvo/ames.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index bd3d98732..3407deefc 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -413,7 +413,7 @@ vix=(bex +((cut 0 [25 2] mag))) :: width of sender tay=(cut 0 [27 5] mag) :: message type == - ?> =(2 vez) + ?> =(3 vez) ?> =(chk (end 0 20 (mug bod))) :+ [(end 3 wix bod) (cut 3 [wix vix] bod)] (kins tay) @@ -433,7 +433,7 @@ =+ tay=(ksin q.kec) %+ mix %+ can 0 - :~ [3 2] + :~ [3 3] [20 (mug bod)] [2 yax] [2 qax] @@ -1018,7 +1018,7 @@ ++ gnaw :: gnaw:am |= [kay=cape ryn=lane pac=rock] :: process packet ^- [p=(list boon) q=fort] - ?. =(2 (end 0 3 pac)) [~ fox] + ?. =(3 (end 0 3 pac)) [~ fox] =+ kec=(bite pac) ?: (goop p.p.kec) [~ fox] ?. (~(has by urb.ton.fox) q.p.kec) From aca6beec281e12d4d68aab18686c9dbffe4d03e4 Mon Sep 17 00:00:00 2001 From: vere Date: Tue, 1 Sep 2015 17:38:21 +0000 Subject: [PATCH 06/20] ignore bad %went in gall --- arvo/gall.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 19a7b5859..accb6aa35 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -333,7 +333,9 @@ :: %red :: diff ack ?> ?=([@ @ @ ~] t.pax) - ?> ?=([%a %woot *] sih) + ?. ?=([%a %woot *] sih) + ~& [%red-went pax] + +>.$ =+ :* him=(slav %p i.t.pax) dap=i.t.t.pax num=(slav %ud i.t.t.t.pax) From 9c1e695e8af1e9b058fa76d5670979f13f2c99b7 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 1 Sep 2015 11:27:12 -0700 Subject: [PATCH 07/20] show work-tasks on talk web frontend, clean up {foo}=React.DOM --- mar/talk/report.hoon | 11 ++-- .../src/js/components/MemberComponent.coffee | 2 +- .../js/components/MessagesComponent.coffee | 28 +++++----- .../js/components/StationsComponent.coffee | 2 +- .../src/js/components/TalkComponent.coffee | 2 +- .../src/js/components/WritingComponent.coffee | 2 +- pub/talk/src/js/main.js | 56 +++++++++++-------- 7 files changed, 59 insertions(+), 44 deletions(-) diff --git a/mar/talk/report.hoon b/mar/talk/report.hoon index 42c49a4d3..ad9fae91b 100644 --- a/mar/talk/report.hoon +++ b/mar/talk/report.hoon @@ -87,11 +87,12 @@ |= a=speech %+ joba -.a ?+ -.a ~|(stub/-.a !!) - %lin (jobe say/[%b p.a] txt/[%s q.a] ~) - %url (jobe url/[%s (crip (earf p.a))] ~) - %exp (jobe code/[%s p.a] ~) - %app (jobe app/[%s p.a] txt/[%s q.a] ~) - %fat (jobe fat/(tors p.a) taf/$(a q.a) ~) + %lin (jobe txt/[%s q.a] say/[%b p.a] ~) + %url (joba txt/[%s (crip (earf p.a))]) + %exp (joba txt/[%s p.a]) + %tax (joba txt/(jape )) + %app (jobe txt/[%s q.a] src/[%s p.a] ~) + %fat (jobe tor/(tors p.a) taf/$(a q.a) ~) :: %inv (jobe ship/(jope p.a) party/[%s q.a] ~) == :: diff --git a/pub/talk/src/js/components/MemberComponent.coffee b/pub/talk/src/js/components/MemberComponent.coffee index 965320ca1..5dff6db47 100644 --- a/pub/talk/src/js/components/MemberComponent.coffee +++ b/pub/talk/src/js/components/MemberComponent.coffee @@ -1,5 +1,5 @@ recl = React.createClass -[div,input,textarea] = [React.DOM.div,React.DOM.input,React.DOM.textarea] +{div,input,textarea} = React.DOM module.exports = recl render: -> diff --git a/pub/talk/src/js/components/MessagesComponent.coffee b/pub/talk/src/js/components/MessagesComponent.coffee index f9878d6ac..c67b5f79d 100644 --- a/pub/talk/src/js/components/MessagesComponent.coffee +++ b/pub/talk/src/js/components/MessagesComponent.coffee @@ -1,7 +1,7 @@ moment = require 'moment-timezone' recl = React.createClass -[div,pre,br,input,textarea,a] = [React.DOM.div,React.DOM.pre,React.DOM.br,React.DOM.input,React.DOM.textarea,React.DOM.a] +{div,pre,br,input,textarea,a} = React.DOM MessageActions = require '../actions/MessageActions.coffee' MessageStore = require '../stores/MessageStore.coffee' @@ -51,17 +51,19 @@ Message = recl type = ['private','public'] type = type[Number(aude.indexOf(window.util.mainStationPath(window.urb.user)) is -1)] - if speech.lin?.txt then txt = speech.lin.txt - if speech.url - url = speech.url.url - txt = (a {href:url,target:"_blank"}, url) - if speech.app - txt = speech.app.txt - klass += " say" - if speech.exp - txt = speech.exp.code - klass += " exp" - + mess = switch + when (con = speech.lin) or (con = speech.app) or + (con = speech.exp) or (con = speech.tax) + con.txt + when (con = speech.url) + (a {href:con.txt,target:"_blank"}, con.txt) + else "Unknown speech type:" + (" %"+x for x of speech).join '' + + klass += switch + when speech.app? then " say" + when speech.exp? then " exp" + else "" + div {className:"message#{klass}"}, [ (div {className:"attr"}, [ div {className:"type #{type}"}, "" @@ -69,7 +71,7 @@ Message = recl div {onClick:@_handleAudi,className:"audi"}, audi div {className:"time"}, @convTime @props.thought.statement.date ]) - div {className:"mess"}, txt, + div {className:"mess"}, mess, if attachments.length div {className:"fat"}, attachments ] diff --git a/pub/talk/src/js/components/StationsComponent.coffee b/pub/talk/src/js/components/StationsComponent.coffee index 7940a2aae..0309ffc32 100644 --- a/pub/talk/src/js/components/StationsComponent.coffee +++ b/pub/talk/src/js/components/StationsComponent.coffee @@ -1,5 +1,5 @@ recl = React.createClass -[div,input] = [React.DOM.div,React.DOM.input] +{div,input} = React.DOM StationStore = require '../stores/StationStore.coffee' StationActions = require '../actions/StationActions.coffee' diff --git a/pub/talk/src/js/components/TalkComponent.coffee b/pub/talk/src/js/components/TalkComponent.coffee index d9191c9b5..ae816c81e 100644 --- a/pub/talk/src/js/components/TalkComponent.coffee +++ b/pub/talk/src/js/components/TalkComponent.coffee @@ -1,6 +1,6 @@ recl = React.createClass recf = React.createFactory -[div] = [React.DOM.div] +{div} = React.DOM StationComponent = recf require './StationComponent.coffee' MessagesComponent = recf require './MessagesComponent.coffee' diff --git a/pub/talk/src/js/components/WritingComponent.coffee b/pub/talk/src/js/components/WritingComponent.coffee index 7e6ae4b5e..0b065f028 100644 --- a/pub/talk/src/js/components/WritingComponent.coffee +++ b/pub/talk/src/js/components/WritingComponent.coffee @@ -1,5 +1,5 @@ recl = React.createClass -[div,br,input,textarea] = [React.DOM.div,React.DOM.br,React.DOM.input,React.DOM.textarea] +{div,br,input,textarea} = React.DOM MessageActions = require '../actions/MessageActions.coffee' MessageStore = require '../stores/MessageStore.coffee' diff --git a/pub/talk/src/js/main.js b/pub/talk/src/js/main.js index 3abab17e6..df9980e67 100644 --- a/pub/talk/src/js/main.js +++ b/pub/talk/src/js/main.js @@ -184,7 +184,7 @@ var div, input, recl, ref, textarea; recl = React.createClass; -ref = [React.DOM.div, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2]; +ref = React.DOM, div = ref.div, input = ref.input, textarea = ref.textarea; module.exports = recl({ render: function() { @@ -215,7 +215,7 @@ moment = require('moment-timezone'); recl = React.createClass; -ref = [React.DOM.div, React.DOM.pre, React.DOM.br, React.DOM.input, React.DOM.textarea, React.DOM.a], div = ref[0], pre = ref[1], br = ref[2], input = ref[3], textarea = ref[4], a = ref[5]; +ref = React.DOM, div = ref.div, pre = ref.pre, br = ref.br, input = ref.input, textarea = ref.textarea, a = ref.a; MessageActions = require('../actions/MessageActions.coffee'); @@ -262,7 +262,7 @@ Message = recl({ return this.props._handlePm(user); }, render: function() { - var attachments, aude, audi, delivery, klass, name, ref1, ref2, speech, txt, type, url; + var attachments, aude, audi, con, delivery, klass, mess, name, ref1, speech, type, x; delivery = _.uniq(_.pluck(this.props.thought.audience, "delivery")); klass = delivery.indexOf("received") !== -1 ? " received" : " pending"; speech = this.props.thought.statement.speech; @@ -295,24 +295,36 @@ Message = recl({ }); type = ['private', 'public']; type = type[Number(aude.indexOf(window.util.mainStationPath(window.urb.user)) === -1)]; - if ((ref2 = speech.lin) != null ? ref2.txt : void 0) { - txt = speech.lin.txt; - } - if (speech.url) { - url = speech.url.url; - txt = a({ - href: url, - target: "_blank" - }, url); - } - if (speech.app) { - txt = speech.app.txt; - klass += " say"; - } - if (speech.exp) { - txt = speech.exp.code; - klass += " exp"; - } + mess = (function() { + switch (false) { + case !((con = speech.lin) || (con = speech.app) || (con = speech.exp) || (con = speech.tax)): + return con.txt; + case !(con = speech.url): + return a({ + href: con.txt, + target: "_blank" + }, con.txt); + default: + return "Unknown speech type:" + ((function() { + var results; + results = []; + for (x in speech) { + results.push(" %" + x); + } + return results; + })()).join(''); + } + })(); + klass += (function() { + switch (false) { + case speech.app == null: + return " say"; + case speech.exp == null: + return " exp"; + default: + return ""; + } + })(); return div({ className: "message" + klass }, [ @@ -333,7 +345,7 @@ Message = recl({ }, this.convTime(this.props.thought.statement.date)) ]), div({ className: "mess" - }, txt, attachments.length ? div({ + }, mess, attachments.length ? div({ className: "fat" }, attachments) : void 0) ]); From f8fd191b4b7a700755298b142503b82dcd479669 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 1 Sep 2015 12:35:42 -0700 Subject: [PATCH 08/20] prettier printing --- ape/talk.hoon | 2 +- lib/talk.hoon | 25 +++++++++++++++++++++++++ mar/talk/report.hoon | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ape/talk.hoon b/ape/talk.hoon index 8d4e451dd..b88d2710c 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1679,7 +1679,7 @@ "[{(trip p.sep)}]: {(trip q.sep)}" :: %tax - " {}: {}" + " {(rend-work-duty p.sep)}" == -- :: diff --git a/lib/talk.hoon b/lib/talk.hoon index 0bd229acb..ab5a3bb7d 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -29,4 +29,29 @@ :+ (shaf %thot eny) [[[%& our (main our)] [*envelope %pending]] ~ ~] [now *bouquet [%app dap (crip ~(ram re i.mes))]] +++ rend-work-duty + =+ work-stuff + |^ |= due=duty ^- tape + ?- -.due + %archive =+(due " -{(tr-id id)} {(trip -.due)}.") + %create =+(due " -{(tr-id id.tax)} {(trip -.due)}: {}") + %change =+(due " -{(tr-id id)} {(trip -.due)}: {(tr-meat meat)}") + %update + =+ due + " -{(tr-id id)} {(trip -.due)} {} by {}: {(tr-meat meat.due)}" + == + ++ tr-id |=(a=@uv (scow %uv (rsh 2 25 a))) + ++ tr-term |=(a=term (rash a (star ;~(pose (cold ' ' hep) next)))) + ++ tr-meat + |= feh=flesh ^- tape + ?- -.feh + %set-done =+(feh ?:(don (tr-term -.feh) (tr-term %set-undone))) + %set-doer =+(feh "{(tr-term -.feh)} {?~(her "none" )}") + %set-date-due =+(feh "{(tr-term -.feh)} {?~(wen "none" )}") + %set-tags =+(feh "{(tr-term -.feh)} {}") + %set-title =+(feh "{(tr-term -.feh)} {}") + %set-description =+(feh "{(tr-term -.feh)} {}") + %add-comment =+(feh "{(tr-term -.feh)} {}") + == + -- -- diff --git a/mar/talk/report.hoon b/mar/talk/report.hoon index ad9fae91b..53c9e7ba8 100644 --- a/mar/talk/report.hoon +++ b/mar/talk/report.hoon @@ -3,6 +3,7 @@ :: /? 314 /- *talk +/+ talk !: |_ rep=report :: @@ -90,7 +91,7 @@ %lin (jobe txt/[%s q.a] say/[%b p.a] ~) %url (joba txt/[%s (crip (earf p.a))]) %exp (joba txt/[%s p.a]) - %tax (joba txt/(jape )) + %tax (joba txt/(jape (rend-work-duty p.a))) %app (jobe txt/[%s q.a] src/[%s p.a] ~) %fat (jobe tor/(tors p.a) taf/$(a q.a) ~) :: %inv (jobe ship/(jope p.a) party/[%s q.a] ~) From f49894ad662d908a0e80855e2eb8027b1a76fdd2 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 1 Sep 2015 14:05:36 -0700 Subject: [PATCH 09/20] better work-task apostrophe handling --- lib/talk.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/talk.hoon b/lib/talk.hoon index ab5a3bb7d..41d4cfc11 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -49,9 +49,9 @@ %set-doer =+(feh "{(tr-term -.feh)} {?~(her "none" )}") %set-date-due =+(feh "{(tr-term -.feh)} {?~(wen "none" )}") %set-tags =+(feh "{(tr-term -.feh)} {}") - %set-title =+(feh "{(tr-term -.feh)} {}") - %set-description =+(feh "{(tr-term -.feh)} {}") - %add-comment =+(feh "{(tr-term -.feh)} {}") + %set-title =+(feh "{(tr-term -.feh)} {<(trip til)>}") + %set-description =+(feh "{(tr-term -.feh)} {<(trip des)>}") + %add-comment =+(feh "{(tr-term -.feh)} {<(trip com)>}") == -- -- From 8e3933a0c31e5e6ce3e10c3ad9758384fd1b5679 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 2 Sep 2015 12:03:44 -0700 Subject: [PATCH 10/20] fixed optional argument parser, usage in |merge --- ape/dojo.hoon | 10 +++------- cat/hood/merge.hoon | 5 ++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 2e76c53ea..312c4c860 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -208,14 +208,10 @@ (star ;~(pfix ace dp-value)) %+ cook ~(gas by *(map term (unit dojo-source))) - %+ more - ;~(plug com ace) + %+ more com ;~ plug - ;~(pfix tis sym) - ;~ pose - ;~(pfix ace (stag ~ dp-value)) - (easy ~) - == + ;~(pfix ace tis sym) + (punt ;~(pfix ace dp-value)) == == -- diff --git a/cat/hood/merge.hoon b/cat/hood/merge.hoon index f8b98c3c4..49fe271c8 100644 --- a/cat/hood/merge.hoon +++ b/cat/hood/merge.hoon @@ -11,12 +11,11 @@ :::: !: |= $: [now=@da eny=@uvI bek=beak] - [arg=[?(sorc [syd=$|(desk beaky) sorc])] opt=(map ,%gem germ)] + [arg=[?(sorc [syd=$|(desk beaky) sorc])] gem=?(%auto germ)] == =* our p.bek |^ :- %kiln-merge - ^- [syd=desk her=ship sud=desk gem=?(germ %auto)] - =+ gem=(fall (~(get by opt) %gem) %auto) + ^- [syd=desk her=ship sud=desk gem=?(%auto germ)] ?- arg [@ @ ~] =+(arg [sud ?.(=(our her) her (sein her)) sud gem]) [^ ~] =+((pars bek.arg) [dez ?.(=(our who) who (sein who)) dez gem]) From 534f1eb05be03e7fa5458dab45a59d25006abb43 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 2 Sep 2015 13:17:06 -0700 Subject: [PATCH 11/20] Why does this file keep disappearing --- cat/hood/unsync.hoon | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cat/hood/unsync.hoon diff --git a/cat/hood/unsync.hoon b/cat/hood/unsync.hoon new file mode 100644 index 000000000..655ba2828 --- /dev/null +++ b/cat/hood/unsync.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/unsync/hood/cat + :: +/? 314 +:: +:::: + !: +|= $: [now=@da eny=@uvI bec=beak] + [arg=[syd=@tas her=@p sud=@tas ~] ~] + == +:- %kiln-unsync +[syd her sud]:arg From 24d762bbc4949ea0d918c93ffb1ff1842f453593 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 2 Sep 2015 16:13:33 -0700 Subject: [PATCH 12/20] minor dicsussion change --- pub/work/src/css/main.css | 2 +- pub/work/src/css/main.styl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pub/work/src/css/main.css b/pub/work/src/css/main.css index 4346f818e..069c30172 100644 --- a/pub/work/src/css/main.css +++ b/pub/work/src/css/main.css @@ -315,7 +315,7 @@ h1.leader:after { margin: 0.5rem 0 0.5rem 2rem; } .item .discussion { - max-height: 18rem; + max-height: 9rem; overflow-x: hidden; overflow-y: scroll; } diff --git a/pub/work/src/css/main.styl b/pub/work/src/css/main.styl index a7083a210..c0c3df079 100644 --- a/pub/work/src/css/main.styl +++ b/pub/work/src/css/main.styl @@ -239,7 +239,7 @@ h1.leader:after margin .5rem 0 .5rem 2rem .discussion - max-height 18rem + max-height 9rem overflow-x hidden overflow-y scroll From b4aa32a36d9ea3078aa1b4eb6ecadea5ccb78d54 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 2 Sep 2015 16:30:37 -0700 Subject: [PATCH 13/20] title width --- pub/work/src/css/main.css | 2 +- pub/work/src/css/main.styl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pub/work/src/css/main.css b/pub/work/src/css/main.css index 069c30172..0027d7a5f 100644 --- a/pub/work/src/css/main.css +++ b/pub/work/src/css/main.css @@ -301,7 +301,7 @@ h1.leader:after { height: 2rem; } .item .title { - min-width: 16rem; + width: 16rem; margin-left: 0.5rem; } .item .date, diff --git a/pub/work/src/css/main.styl b/pub/work/src/css/main.styl index c0c3df079..291a869c3 100644 --- a/pub/work/src/css/main.styl +++ b/pub/work/src/css/main.styl @@ -225,7 +225,7 @@ h1.leader:after height 2rem .title - min-width 16rem + width 16rem margin-left .5rem .date From 24f9eb335758cd4edda20c92ec1361491f5e34be Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 2 Sep 2015 16:41:34 -0700 Subject: [PATCH 14/20] date detail --- pub/work/src/css/main.styl | 1 + 1 file changed, 1 insertion(+) diff --git a/pub/work/src/css/main.styl b/pub/work/src/css/main.styl index 291a869c3..c6554c5c0 100644 --- a/pub/work/src/css/main.styl +++ b/pub/work/src/css/main.styl @@ -275,6 +275,7 @@ h1.leader:after .date .ship + max-width 12rem margin-right 1rem .body From 9cc84597aa49f31ce3949412331c2a39675cc052 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 2 Sep 2015 16:43:14 -0700 Subject: [PATCH 15/20] compiled css --- pub/work/src/css/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/pub/work/src/css/main.css b/pub/work/src/css/main.css index 0027d7a5f..4d6fb0cf7 100644 --- a/pub/work/src/css/main.css +++ b/pub/work/src/css/main.css @@ -352,6 +352,7 @@ h1.leader:after { } .comment .date, .comment .ship { + max-width: 12rem; margin-right: 1rem; } .comment .body { From 5c47efdd29972aaae47597c51473f05afa61c05c Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 3 Sep 2015 15:10:18 -0700 Subject: [PATCH 16/20] multiline, tall expressions --- ape/dojo.hoon | 56 +++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 312c4c860..013dc8383 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -9,7 +9,8 @@ !: :: :: => |% :: external structures ++ house :: all state - $: hoc=(map bone session) :: conversations + $: %0 + hoc=(map bone session) :: conversations == :: ++ session :: per conversation $: say=sole-share :: command-line state @@ -18,6 +19,7 @@ poy=(unit dojo-project) :: working var=(map term cage) :: variable state old=(set term) :: used TLVs + buf=tape :: multiline buffer == :: ++ dojo-command :: $% [%flat p=path q=dojo-source] :: noun to unix atom @@ -103,6 +105,7 @@ |_ [[ost=bone moz=(list move)] session] :: ++ dp :: dojo parser |% + ++ dp-command-line ;~(sfix dp-command (just '\0a')) ++ dp-command :: ++dojo-command %+ knee *dojo-command |. ~+ ;~ pose @@ -192,7 +195,7 @@ ++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server ++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server ++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server - ++ dp-twig wide:(vang & dp-path) :: ++twig + ++ dp-twig tall:(vang & dp-path) :: ++twig ++ dp-device (most fas sym) :: ++dojo-device ++ dp-value :: ++dojo-source %+ cook |=(a=dojo-source a) @@ -515,19 +518,23 @@ :: ++ he-dope :: sole user of ++dp |= txt=tape :: - ^- (each (unit dojo-command) hair) :: prefix/result - =+ vex=((full dp-command):dp [1 1] txt) :: - ?. =(+((lent txt)) q.p.vex) :: fully parsed - [%| p.p.vex (dec q.p.vex)] :: syntax error - [%& ?~(q.vex ~ `p.u.q.vex)] :: prefix/complete + ^- (each (unit (each dojo-command tape)) hair) :: prefix/result + =+ len=+((lent txt)) :: line length + =. txt :(weld buf txt "\0a") :: + =+ vex=((full dp-command-line):dp [1 1] txt) :: + ?: =(q.p.vex len) :: matched until line end + [%& ~] :: + ?: =(p.p.vex +((lent (skim txt |=(a=@ =(10 a)))))) :: parsed all lines + [%& ~ ?~(q.vex [%| txt] `p.u.q.vex)] :: new buffer/complete + [%| p.p.vex (dec q.p.vex)] :: syntax error :: ++ he-duke :: ++he-dope variant |= txt=tape - ^- (each dojo-command ,@ud) + ^- (each (unit (each dojo-command tape)) ,@ud) =+ foy=(he-dope txt) ?- -.foy %| [%| q.p.foy] - %& ?~(p.foy [%| (lent txt)] [%& u.p.foy]) + %& [%& p.foy] == :: ++ he-abet :: resolve @@ -627,7 +634,7 @@ |= mad=dojo-command ^+ +> ?> ?=(~ poy) - he-pine:(dy-step:~(dy-init dy mad [0 ~ ~ ~ ~ ~ ~]) 0) + he-pine:(dy-step:~(dy-init dy %*(. *dojo-project mad mad)) 0) :: ++ he-done :: parse command |= txt=tape @@ -642,15 +649,14 @@ ?- -.doy %| (he-diff [%err p.doy]) %& + ?~ p.doy + (he-diff [%err (lent txt)]) =+ old=(weld "> " (tufa buf.say)) =^ cal say (~(transmit cs say) [%set ~]) - %. p.doy - =< he-plan - %- he-diff - :~ %mor - [%txt old] - [%nex ~] - [%det cal] + =. +>.$ (he-diff %mor txt/old nex/~ det/cal ~) + ?- -.u.p.doy + %& (he-plan(buf ~) p.u.p.doy) + %| +>.$(buf p.u.p.doy) == == :: @@ -665,6 +671,14 @@ == -- :: +++ prep + =+ sosh==>(*session .(|5 old)) + |= old=(unit ?(house (map bone ,_sosh))) ^+ [~ ..prep] + ?~ old `..prep + ?. ?=([@ *] u.old) + $(u.old [%0 (~(run by u.old) |=(sos=_sosh sos(|5 [|5.sos ""])))]) + `..prep(+<+ u.old) +:: ++ peer-sole |= [pax=path] ^- (quip move +>) @@ -677,13 +691,7 @@ %~ he-peer he :- [ost.hid ~] ^- session - :* *sole-share :: say=sole-share - %home :: syd=desk - ~ :: luc=(unit case) - ~ :: poy=(unit dojo-project) - ~ :: var=(map term cage) - ~ :: old=(set term) - == + %*(. *session syd %home) :: ++ poke-sole-action |= [act=sole-action] From d9eca53958e32c1de271c00407b6a45e782fef17 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 3 Sep 2015 16:17:34 -0700 Subject: [PATCH 17/20] dojo restart, variables, file writing --- ape/dojo.hoon | 37 ++++++++++++++++++++++++++++++------- lib/drum.hoon | 2 ++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 013dc8383..894a866f6 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -25,6 +25,7 @@ $% [%flat p=path q=dojo-source] :: noun to unix atom [%pill p=path q=dojo-source] :: noun to unix pill :: [%tree p=path q=dojo-source] :: noun to unix tree + [%file p=beam q=dojo-source] :: save to clay [%poke p=goal q=dojo-source] :: make and poke [%show p=dojo-source] :: print [%verb p=term q=dojo-source] :: store variable @@ -88,6 +89,7 @@ [%send wire [ship term] clap] :: [%exec wire @p (unit ,[beak silk])] :: [%deal wire sock term club] :: + [%info wire @p toro] :: == :: ++ move (pair bone card) :: user-level move ++ sign :: @@ -151,17 +153,22 @@ :: %+ stag %verb ;~ pfix tis - ;~(plug sym ;~(pfix ace dp-source)) + ;~((glue ace) sym dp-source) + == + :: + %+ stag %file + ;~ pfix tar + ;~((glue ace) dp-beam dp-source) == :: %+ stag %flat ;~ pfix pat - ;~(plug (most fas sym) ;~(pfix ace dp-source)) + ;~((glue ace) (most fas sym) dp-source) == :: %+ stag %pill ;~ pfix dot - ;~(plug (most fas sym) ;~(pfix ace dp-source)) + ;~((glue ace) (most fas sym) dp-source) == :: (stag %show dp-source) @@ -188,10 +195,15 @@ (cook |=(a=term `goal`[our.hid a]) sym) (easy [our.hid %hood]) == + ++ dp-beam :: ++beam + %+ sear tome + =+ vez=(vang & dp-path) + (sear plex:vez (stag %clsg poor:vez)) + :: ++ dp-model-cat ;~(plug dp-server-cat dp-config) :: ++dojo-model ++ dp-model-dog ;~(plug dp-server-dog dp-config) :: ++dojo-model ++ dp-model-pig ;~(plug dp-server-pig dp-config) :: ++dojo-model - ++ dp-path `path`/(scot %p our.hid)/home/(scot %da now.hid) + ++ dp-path `path`/(scot %p our.hid)/[syd]/(scot %da now.hid) ++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server ++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server ++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server @@ -211,9 +223,9 @@ (star ;~(pfix ace dp-value)) %+ cook ~(gas by *(map term (unit dojo-source))) - %+ more com + %- star ;~ plug - ;~(pfix ace tis sym) + ;~(pfix com ace tis sym) (punt ;~(pfix ace dp-value)) == == @@ -225,7 +237,7 @@ ++ dy-amok +>(poy ~) :: terminate ++ dy-beak :: XX rethink ^- beak - [our.hid %home [%da now.hid]] + [our.hid syd [%da now.hid]] :: ++ dy-ford :: send work to ford |= [way=wire kas=silk] @@ -257,6 +269,7 @@ |= mad=dojo-command ^+ [mad +>] ?- -.mad + %file =^(src +>.$ (dy-init-source q.mad) [[%file p.mad src] +>.$]) %flat =^(src +>.$ (dy-init-source q.mad) [[%flat p.mad src] +>.$]) %pill =^(src +>.$ (dy-init-source q.mad) [[%pill p.mad src] +>.$]) %poke =^(src +>.$ (dy-init-source q.mad) [[%poke p.mad src] +>.$]) @@ -385,6 +398,14 @@ %poke (~(got by rez) p.q.mad) == + :: + %file + %- he-card(poy ~) :* + %info + /file + our.hid + (foal (tope p.mad) (~(got by rez) p.q.mad)) + == :: %flat =+ out=q.q:(~(got by rez) p.q.mad) @@ -396,6 +417,7 @@ (dy-rash %sag p.mad q.q:(~(got by rez) p.q.mad)) :: %verb + ~& (~(run by var) mug) dy-amok(var (~(put by var) p.mad (~(got by rez) p.q.mad))) :: %show @@ -492,6 +514,7 @@ %dv [/hand [%core he-beak (flop p.q.u.cud)]] %ec [/hand [%cast p.q.u.cud (dy-mare q.q.u.cud)]] %ex [/hand (dy-mare p.q.u.cud)] + %va [/hand %$ (~(got by var) p.q.u.cud)] %tu :- /hand :- %$ :- %noun diff --git a/lib/drum.hoon b/lib/drum.hoon index 10f7bc3e1..c6fb696be 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -360,6 +360,8 @@ +>.$(inx 0) (se-alas u.lag) =. +>.$ (se-text "[unlinked from {}]") + ?: =(gyl [our %dojo]) :: undead dojo + (se-link gyl) se-prom(liv.maz ?~(fug & liv.maz)) :: ++ se-dump :: print tanks From 4e554b44943c767c32f3a841240fc074a6c653fd Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 1 Sep 2015 17:56:19 -0700 Subject: [PATCH 18/20] reset after a dojo crash, just maybe fixing #295 --- ape/dojo.hoon | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 894a866f6..42e43b8e6 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -692,6 +692,14 @@ %det (he-stir +.act) %ret (he-done (tufa buf.say)) == + :: + ++ he-lame :: handle error + |= [wut=term why=tang] + ^+ +> + %- (slog (flop `tang`[>%dojo-lame wut< why])) + ?^ poy + he-pine:~(dy-amok dy u.poy) + he-pine :: XX give mean to original keystroke -- :: ++ prep @@ -728,6 +736,10 @@ |= [way=wire dep=@uvH reg=gage] he-abet:(~(he-made he [[ost.hid ~] (~(got by hoc) ost.hid)]) way dep reg) :: +++ lame + |= [wut=term why=tang] + he-abet:(~(he-lame he [[ost.hid ~] (~(got by hoc) ost.hid)]) wut why) +:: ++ unto |= [way=wire cit=cuft] he-abet:(~(he-unto he [[ost.hid ~] (~(got by hoc) ost.hid)]) cit) From 7c73a9733f95d484a96cdb2782a4ef4d008c074a Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 3 Sep 2015 18:29:34 -0700 Subject: [PATCH 19/20] libraries and structures --- ape/dojo.hoon | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 42e43b8e6..86183030c 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -16,7 +16,8 @@ $: say=sole-share :: command-line state syd=desk :: active desk luc=(unit case) :: special case - poy=(unit dojo-project) :: working + poy=(unit dojo-project) :: working + [lib=(list hoof) arc=(list hoof)] :: lib/sur var=(map term cage) :: variable state old=(set term) :: used TLVs buf=tape :: multiline buffer @@ -235,15 +236,11 @@ |_ dojo-project :: ++ dy-abet +>(poy `+<) :: resolve ++ dy-amok +>(poy ~) :: terminate - ++ dy-beak :: XX rethink - ^- beak - [our.hid syd [%da now.hid]] - :: ++ dy-ford :: send work to ford |= [way=wire kas=silk] ^+ +>+> ?> ?=(~ pux) - (he-card(poy `+>+<(pux `way)) %exec way our.hid `[dy-beak kas]) + (he-card(poy `+>+<(pux `way)) %exec way our.hid `[he-beak kas]) :: ++ dy-stop :: stop work ^+ +> @@ -418,7 +415,17 @@ :: %verb ~& (~(run by var) mug) - dy-amok(var (~(put by var) p.mad (~(got by rez) p.q.mad))) + =+ cay=(~(got by rez) p.q.mad) + ~| bad-set/[p.mad p.q.cay] + =< dy-amok + ?+ p.mad .(var (~(put by var) p.mad cay)) + %now ~|(%time-is-immutable !!) + %who ~|(%self-is-immutable !!) + %law .(syd ;;(@tas q.q.cay)) + %dir ~|(%cd-stub ?>(?=(~ q.q.cay) .)) + %lib .(lib ;;((list hoof) q.q.cay)) + %arc .(arc ;;((list hoof) q.q.cay)) + == :: %show =+ cay=(~(got by rez) p.p.mad) @@ -474,8 +481,13 @@ (dy-silk-config cag cig) :: ++ dy-twig-head :: dynamic state - ^- vase - :(slop !>(`our=@p`our.hid) !>(`now=@da`now.hid) !>(`eny=@uvI`eny.hid)) + ^- cage + :- %noun + !> ^- $: law=desk dir=path + [lib=(list hoof) arc=(list hoof)] + [our=@p now=@da eny=@uvI] + == + [syd / [lib arc] [our now eny]:hid] :: ++ dy-made-dial :: dialog product |= cag=cage @@ -528,7 +540,10 @@ ++ dy-mare :: build expression |= gen=twig ^- silk - [%ride gen [[%$ %$ dy-twig-head] [%reef ~]]] + :+ %ride gen + :- [%$ dy-twig-head] + =+ sur=(turn arc |=(hoof [& +<])) + [%plan [he-beak ~] / zuse sur lib ~ ~] :: XX spur :: ++ dy-step :: advance project |= nex=@ud @@ -703,11 +718,15 @@ -- :: ++ prep - =+ sosh==>(*session .(|5 old)) + =+ sosh==>(*session .(|4 |5(+ old))) + :: ,_`..prep |= old=(unit ?(house (map bone ,_sosh))) ^+ [~ ..prep] ?~ old `..prep ?. ?=([@ *] u.old) - $(u.old [%0 (~(run by u.old) |=(sos=_sosh sos(|5 [|5.sos ""])))]) + %= $ + u.old + [%0 (~(run by u.old) |=(sos=_sosh sos(|4 [[~ ~] &5.sos |5.sos ""])))] + == `..prep(+<+ u.old) :: ++ peer-sole From d051e2347a36135eee93010cb00fedba089aa1ab Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 3 Sep 2015 18:40:30 -0700 Subject: [PATCH 20/20] cosmetic multiline display change --- ape/dojo.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 86183030c..08fe7ae32 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -689,7 +689,7 @@ %& ?~ p.doy (he-diff [%err (lent txt)]) - =+ old=(weld "> " (tufa buf.say)) + =+ old=(weld ?~(buf "> " " ") (tufa buf.say)) =^ cal say (~(transmit cs say) [%set ~]) =. +>.$ (he-diff %mor txt/old nex/~ det/cal ~) ?- -.u.p.doy