@@ 30,9 30,10 @@ func init() {
flag.StringVar(&config.Theme, "theme", "light", "theme to use {light,dark}")
flag.StringVar(&profileOpt, "profile", "none", "create the provided kind of profile. Use one of [none, cpu, mem, block, goroutine, mutex, trace, gio]")
flag.BoolVar(&config.UsePlato, "plato", false, "use Plato Team Inc themed widgets")
+ flag.BoolVar(&config.ScrollToEnd, "scroll-end", true, "start chat interfaces looking at the most recent chat messages, rather than the oldest")
flag.IntVar(&config.Latency, "latency", 1000, "maximum latency (in millis) to simulate")
flag.IntVar(&config.LoadSize, "load-size", 30, "number of items to load at a time")
- flag.IntVar(&config.BufferSize, "buffer-size", 30, "number of elements to hold in memory before compacting")
+ flag.IntVar(&config.BufferSize, "buffer-size", 100, "number of elements to hold in memory before compacting")
flag.Parse()
}
@@ 50,6 50,9 @@ type Config struct {
// bufferSize specifies how many elements to hold in memory before
// compacting the list.
BufferSize int
+ // ScrollToEnd controls whether the chat interfaces start looking at the beginning
+ // or end of the chat content.
+ ScrollToEnd bool
}
// th is the active theme object.
@@ 168,7 171,7 @@ func NewUI(invalidator func(), conf Config) *UI {
rt := NewExampleData(users, local, g, 100)
rt.SimulateLatency = conf.Latency
rt.MaxLoads = conf.LoadSize
- rt.ScrollToEnd = false
+ rt.ScrollToEnd = conf.ScrollToEnd
lm := list.NewManager(conf.BufferSize,
list.Hooks{
// Define an allocator function that can instaniate the appropriate