Commit Graph

13 Commits

Author SHA1 Message Date
Steve Howell 5ba79f9c3a refactor: Move respond/reply methods to compose_actions.js.
This moves respond_to_mention() and reply_with_mention() to
compose_actions.js.  These methods are basically thin layers
on top of compose_actions.start().
2017-04-14 13:09:19 -07:00
Steve Howell dd0c50f0df Extract compose_actions.js.
This module extracts these two functions that get called by
several other modules:

    start()
    cancel()

It is a little bit arbitrary which functions got pulled over
with them, but it's generally functions that would have only
been called via start/cancel.

There are two goals for splitting out this code.  The first
goal is simply to make `compose.js` have fewer responsibilities.
The second goal is to help break up circular dependencies.
The extraction of this module does more to clarify
dependencies than actually break them.  The methods start()
and cancel() had actually been shimmed in an earlier commit,
and now they no longer have a shim.

Besides start/cancel, most of the functions here are only
exported to facilitate test stubbing.  An exception is
decorate_stream_bar(), which is currently called from
ui_init.js.  We probably should move the "blur" handler out
of there, but cleaning up ui_init.js is a project for another
day.

It may seem slightly odd that this commit doesn't pull over
finish() into this module, but finish() would bring in the
whole send-message codepath.  You can think of it like this:

* compose_actions basically just populates the compose box
* compose.finish() makes the compose box do its real job,
  which is to send a message
2017-04-14 13:09:19 -07:00
Steve Howell f37ce1eeb1 Extract settings_lab.js. 2017-04-06 11:28:36 -07:00
Steve Howell 89128a2272 Extract settings_muting.js. 2017-04-06 11:28:36 -07:00
Steve Howell 1f38884b27 Extract settings_notifications.js. 2017-04-06 11:28:36 -07:00
Steve Howell 3d1ce3fafe js deps: Approve some more deps to break. 2017-03-30 15:35:57 -07:00
Steve Howell 36b29a966e Add roadmap feature to js-dep-visualizer.
The js-dep-visualizer tool now attempts to find a set of edges
to remove from a call graph that would reduce it to having only
trivial mutual dependencies, and it produces a roadmap of the
changes that need to happen.

If the tool can't reduce the graph all the way, it still produces
a DOT file that can be visualized.

This fix also has some significant code cleanup.
2017-03-21 07:39:30 -07:00
Steve Howell edb8b0cb5e Improve js-dep-visualizer.
This adds a report of nodes, handles some errors better, adds
some helpful output, cleans up some abspath calls, and
updates which modules and/or dependencies we temporarily are
ignoring for the report.
2017-03-19 21:03:45 -07:00
Steve Howell 6f3f031791 Make visualizer tool scan each file just once.
Rather than having a bunch of regexes to look for, we just
have a single regex for a function call.  And now we process
line by line, which allows us to more easily ignore comments.
2017-03-19 06:25:10 -07:00
Steve Howell 16a37754cf Add recipient() and composing() shims. 2017-03-18 15:52:50 -07:00
Steve Howell 758ff2e756 Exclude more nodes/edges from our JS visualization.
This also provides a roadmap for how to break some dependencies.
2017-03-17 20:53:02 -07:00
Tim Abbott af8732fd42 py3: Remove unnecesary use of filter. 2017-03-17 20:30:22 -07:00
Tommy Ip da49db0201 Create tools/js-dep-visualizer.py.
This tools lets us view circular dependencies in our JS
code.  It does regex parsing, so it has a few false positives,
but it's an early draft of the tools.  Steve Howell helped
with this commit.
2017-03-17 16:09:21 -07:00